Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed May 22, 2020
1 parent 0d12595 commit 68c7ca9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/override-promise.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import path from 'path';
import test from 'ava';

process.env.PATH = path.join(__dirname, 'fixtures') + path.delimiter + process.env.PATH;
process.env.FOO = 'foo';

// Can't use `test.before`, maybe because `ava` need `Promise`
// Can't use `import('..')` too, unknown reason
const nativePromise = Promise;
Expand All @@ -12,6 +16,6 @@ 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');
const {stdout} = await execa('noop', ['foo']);
t.is(stdout, 'foo');
});

0 comments on commit 68c7ca9

Please sign in to comment.