-
-
Notifications
You must be signed in to change notification settings - Fork 608
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
24 changed files
with
410 additions
and
113 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
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
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,32 @@ | ||
'use strict'; | ||
|
||
const { run } = require('../../utils/test-utils'); | ||
|
||
describe('error', () => { | ||
it('should log error with stacktrace', async () => { | ||
const { exitCode, stderr, stdout } = await run(__dirname); | ||
|
||
expect(exitCode).toBe(2); | ||
expect(stderr).toContain('Error: test'); | ||
expect(stderr).toMatch(/at .+ (.+)/); | ||
expect(stdout).toBeFalsy(); | ||
}); | ||
|
||
it('should log error with stacktrace using the "bundle" command', async () => { | ||
const { exitCode, stderr, stdout } = await run(__dirname, ['bundle']); | ||
|
||
expect(exitCode).toBe(2); | ||
expect(stderr).toContain('Error: test'); | ||
expect(stderr).toMatch(/at .+ (.+)/); | ||
expect(stdout).toBeFalsy(); | ||
}); | ||
|
||
it('should log error with stacktrace using the "serve" command', async () => { | ||
const { exitCode, stderr, stdout } = await run(__dirname, ['serve']); | ||
|
||
expect(exitCode).toBe(2); | ||
expect(stderr).toContain('Error: test'); | ||
expect(stderr).toMatch(/at .+ (.+)/); | ||
expect(stdout).toBeFalsy(); | ||
}); | ||
}); |
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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,73 @@ | ||
'use strict'; | ||
const { run, isWebpack5 } = require('../../utils/test-utils'); | ||
|
||
describe('invalid schema', () => { | ||
it('should log error on invalid config', () => { | ||
const { exitCode, stderr, stdout } = run(__dirname, ['--config', './webpack.config.mock.js']); | ||
|
||
expect(exitCode).toEqual(2); | ||
expect(stderr).toContain('Invalid configuration object'); | ||
expect(stdout).toBeFalsy(); | ||
}); | ||
|
||
it('should log error on invalid config using the "bundle" command', () => { | ||
const { exitCode, stderr, stdout } = run(__dirname, ['bundle', '--config', './webpack.config.mock.js']); | ||
|
||
expect(exitCode).toEqual(2); | ||
expect(stderr).toContain('Invalid configuration object'); | ||
expect(stdout).toBeFalsy(); | ||
}); | ||
|
||
it('should log error on invalid config using the "serve" command', () => { | ||
const { exitCode, stderr, stdout } = run(__dirname, ['serve', '--config', './webpack.config.mock.js']); | ||
|
||
expect(exitCode).toEqual(2); | ||
expect(stderr).toContain('Invalid configuration object'); | ||
expect(stdout).toBeFalsy(); | ||
}); | ||
|
||
it('should log error on invalid option', () => { | ||
const { exitCode, stderr, stdout } = run(__dirname, ['--mode', 'Yukihira']); | ||
|
||
expect(exitCode).toEqual(2); | ||
|
||
if (isWebpack5) { | ||
expect(stderr).toContain("Invalid value 'Yukihira' for the '--mode' option"); | ||
expect(stderr).toContain("Expected: 'development | production | none'"); | ||
} else { | ||
expect(stderr).toContain('Invalid configuration object'); | ||
} | ||
|
||
expect(stdout).toBeFalsy(); | ||
}); | ||
|
||
it('should log error on invalid option using "bundle" command', () => { | ||
const { exitCode, stderr, stdout } = run(__dirname, ['bundle', '--mode', 'Yukihira']); | ||
|
||
expect(exitCode).toEqual(2); | ||
|
||
if (isWebpack5) { | ||
expect(stderr).toContain("Invalid value 'Yukihira' for the '--mode' option"); | ||
expect(stderr).toContain("Expected: 'development | production | none'"); | ||
} else { | ||
expect(stderr).toContain('Invalid configuration object'); | ||
} | ||
|
||
expect(stdout).toBeFalsy(); | ||
}); | ||
|
||
it('should log error on invalid option using "server" command', () => { | ||
const { exitCode, stderr, stdout } = run(__dirname, ['serve', '--mode', 'Yukihira']); | ||
|
||
expect(exitCode).toEqual(2); | ||
|
||
if (isWebpack5) { | ||
expect(stderr).toContain("Invalid value 'Yukihira' for the '--mode' option"); | ||
expect(stderr).toContain("Expected: 'development | production | none'"); | ||
} else { | ||
expect(stderr).toContain('Invalid configuration object'); | ||
} | ||
|
||
expect(stdout).toBeFalsy(); | ||
}); | ||
}); |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
test/watch/watch-flag.test.js → test/watch/simple/watch.test.js
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
Oops, something went wrong.