Permalink
Browse files

fix(waitFor): reject with Error rather than string (#84)

* fix(waitFor): reject with Error rather than string

When used in combination with async / await, the value that the promise
is rejected with may be thrown, and throwing a string literal rather
than an Error may cause warnings in some browsers.

* fix: revert changes to dist folder

These changes will be generated during the build.
  • Loading branch information...
RomkeVdMeulen authored and EisenbergEffect committed Sep 20, 2018
1 parent 0635bad commit 054dab5c362fec1e1e970d8053381412cf88b379
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/wait.ts
@@ -38,7 +38,7 @@ export function waitFor<T>(getter: () => T, options: {
new Promise(
(_, rj) => setTimeout(() => {
timedOut = true;
rj(options.present ? 'Element not found' : 'Element not removed');
rj(new Error(options.present ? 'Element not found' : 'Element not removed'));
}, options.timeout)
),
wait()

0 comments on commit 054dab5

Please sign in to comment.