-
-
Notifications
You must be signed in to change notification settings - Fork 597
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: exit process in case of schema errors
- Loading branch information
Showing
6 changed files
with
45 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
'use strict'; | ||
const { run, isWindows } = require('../utils/test-utils'); | ||
|
||
describe('invalid schema', () => { | ||
it('should log webpack error and exit process on invalid config', () => { | ||
const { stderr, stdout, exitCode } = run(__dirname, ['--config', './webpack.config.mock.js']); | ||
console.log({ stderr, stdout, exitCode }); | ||
expect(stderr).toContain('Invalid configuration object'); | ||
// TODO - Fix exitcode check on windows | ||
if (!isWindows) { | ||
expect(exitCode).toEqual(1); | ||
} | ||
}); | ||
|
||
it('should log webpack error and exit process on invalid flag', () => { | ||
const { stderr, exitCode } = run(__dirname, ['--mode', 'Yukihira']); | ||
expect(stderr).toContain('Invalid configuration object'); | ||
// TODO - Fix exitcode check on windows | ||
if (!isWindows) { | ||
expect(exitCode).toEqual(1); | ||
} | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
mode: 'Nishinoya Yuu', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters