Skip to content

Commit

Permalink
tests: devtool-flag
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Jun 26, 2020
1 parent 26c9638 commit 138253d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/core-flags/devtool-flag.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use strict';

const { run } = require('../utils/test-utils');

describe('--devtool flag', () => {
it('should set devtool option', () => {
const { stderr, stdout } = run(__dirname, ['--devtool', 'source-map']);

expect(stderr).toBeFalsy();
expect(stdout).toContain(`devtool: 'source-map'`);
});

it('should throw error for invalid config', () => {
const { stderr } = run(__dirname, ['--devtool', 'invalid']);

expect(stderr).toContain('ValidationError: Invalid configuration object');
});
});

0 comments on commit 138253d

Please sign in to comment.