Skip to content

Commit

Permalink
tests: target
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Sep 12, 2020
1 parent 4dd40b7 commit 1ed309b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/target/flag-test/target-flag.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@ const targetValues = ['web', 'webworker', 'node', 'async-node', 'node-webkit', '

describe('--target flag', () => {
if (version.startsWith('5')) {
it(`should throw error with invalid value for --target`, () => {
it('should allow multiple targets', () => {
const { stderr, stdout } = run(__dirname, ['--target', 'node', '--target', 'async-node']);
expect(stderr).toBeFalsy();
expect(stdout).toContain(`target: [ 'node', 'async-node' ]`);
});

it('should throw error for invalid targets', () => {
const { stderr } = run(__dirname, ['--target', 'invalid']);
expect(stderr).toContain(`Error: Unknown target 'invalid'`);
});
} else {
targetValues.forEach((val) => {
it(`should accept ${val} with --target flag`, (done) => {
Expand Down

0 comments on commit 1ed309b

Please sign in to comment.