Skip to content

Commit

Permalink
Add failed test
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed May 22, 2020
1 parent 120230c commit 3b3596d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/override-promise.js
@@ -0,0 +1,17 @@
import test from 'ava';

// Can't use `test.before`, maybe because `ava` need `Promise`
// Can't use `import('..')` too, unknown reason
const nativePromise = Promise;
global.Promise = class BrokenPromise {
then() {
throw new Error('error');
}
};
const execa = require('..');
global.Promise = nativePromise;

test('Should work with third party Promise', async t => {
const {stdout} = await execa('echo execa');
t.is(stdout, 'execa');
});

0 comments on commit 3b3596d

Please sign in to comment.