Skip to content

Commit

Permalink
[update] try promise.race logic
Browse files Browse the repository at this point in the history
  • Loading branch information
toxic-johann committed Jan 28, 2018
1 parent fbbb104 commit c1c61ca
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/switch-kernel.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ describe('check for chimee switch kernel function', () => {
count++;
});
try {
await chimee.$silentLoad('http://cdn.toxicjohann.com/%E4%BA%8E%E6%98%AF.mp4', { immediate: true });
await new Promise(resolve => setTimeout(resolve, 500));
await Promise.race([
chimee.$silentLoad('http://cdn.toxicjohann.com/%E4%BA%8E%E6%98%AF.mp4', { immediate: true }),
new Promise(resolve => setTimeout(resolve, 8900)),
]);
} catch (error) {
console.error(error);
}
Expand Down

0 comments on commit c1c61ca

Please sign in to comment.