-
-
Notifications
You must be signed in to change notification settings - Fork 667
Expand file tree
/
Copy pathmultiple-config.test.js
More file actions
21 lines (18 loc) · 903 Bytes
/
multiple-config.test.js
File metadata and controls
21 lines (18 loc) · 903 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const { existsSync } = require('fs');
const { resolve } = require('path');
// eslint-disable-next-line node/no-missing-require
const { run } = require('../../utils/test-utils');
describe('Multiple config flag: ', () => {
it('spawns multiple compilers for multiple configs', () => {
const { stdout, stderr, exitCode } = run(__dirname, ['-c', 'webpack1.config.js', '-c', 'webpack2.config.js'], false);
// Should contain the correct exit code
expect(exitCode).toEqual(0);
// Should spawn multiple compilers
expect(stdout).toContain('amd:');
expect(stdout).toContain('commonjs:');
expect(stderr).toBeFalsy();
// should generate the correct output files
expect(existsSync(resolve(__dirname, './dist/dist-commonjs.js'))).toBeTruthy();
expect(existsSync(resolve(__dirname, './dist/dist-amd.js'))).toBeTruthy();
});
});