Skip to content

Commit

Permalink
test: update tests for new execa major
Browse files Browse the repository at this point in the history
  • Loading branch information
shellscape committed Jul 21, 2019
1 parent 24da579 commit d3242f6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,31 +52,31 @@ test('bad', async (t) => {
try {
await run('--config', 'bad.config.js');
} catch (err) {
t.truthy(err.message.includes('WebpackOptionsValidationError'));
t.truthy(err.stderr.includes('WebpackOptionsValidationError'));
}
});

test('bad --config.name', async (t) => {
try {
await run('--config.ye', 'multi.config.js');
} catch (err) {
t.truthy(err.message.includes('RangeError'));
t.truthy(err.stderr.includes('RangeError'));
}
});

test('bad --config.name, non-Array', async (t) => {
try {
await run('--config.ye', 'webpack.config.js');
} catch (err) {
t.truthy(err.message.includes('TypeError'));
t.truthy(err.stderr.includes('TypeError'));
}
});

test('bail', async (t) => {
try {
await run('--config', 'bail.config.js');
} catch (err) {
t.truthy(err.message.includes('⬢ webpack: ModuleNotFoundError'));
t.truthy(err.stderr.includes('⬢ webpack: ModuleNotFoundError'));
}
});

Expand Down Expand Up @@ -107,14 +107,14 @@ test('watch', (t) => {

setTimeout(async () => {
proc.kill();
const { stderr } = await proc;
t.truthy(stderr.includes('⬡ webpack: Watching Files'));
const { all } = await proc;
t.truthy(all.includes('⬡ webpack: Watching Files'));
defer.resolve();
}, 2000);

return defer.promise;
});

//
test('zero config', async (t) => {
const { stderr } = await execa('node', [bin], { cwd: join(cwd, '/zero') });
t.truthy(stderr.includes('⬡ webpack: Build Finished'));
Expand Down

0 comments on commit d3242f6

Please sign in to comment.