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 7fe9e0c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/override-promise.js
@@ -1,5 +1,8 @@
import path from 'path';
import test from 'ava';

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

// Can't use `test.before`, maybe because `ava` need `Promise`
// Can't use `import('..')` too, unknown reason
const nativePromise = Promise;
Expand All @@ -12,6 +15,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 7fe9e0c

Please sign in to comment.