diff --git a/test/serve/basic/serve-basic.test.js b/test/serve/basic/serve-basic.test.js index dff4a541882..16549148b67 100644 --- a/test/serve/basic/serve-basic.test.js +++ b/test/serve/basic/serve-basic.test.js @@ -34,6 +34,33 @@ describe('basic serve usage', () => { expect(stdout).not.toContain('HotModuleReplacementPlugin'); }); + it('should work with the "--mode" option', async () => { + const { stderr, stdout } = await runServe([], __dirname); + + expect(stderr).toBeFalsy(); + expect(stdout).toContain('development'); + expect(stdout).toContain('main.js'); + expect(stdout).not.toContain('HotModuleReplacementPlugin'); + }); + + it('should work with the "--mode" option #2', async () => { + const { stderr, stdout } = await runServe(['--mode', 'production'], __dirname); + + expect(stderr).toBeFalsy(); + expect(stdout).toContain('production'); + expect(stdout).toContain('main.js'); + expect(stdout).not.toContain('HotModuleReplacementPlugin'); + }); + + it('should work with the "--mode" option #2', async () => { + const { stderr, stdout } = await runServe(['--mode', 'development'], __dirname); + + expect(stderr).toBeFalsy(); + expect(stdout).toContain('development'); + expect(stdout).toContain('main.js'); + expect(stdout).not.toContain('HotModuleReplacementPlugin'); + }); + it('should work with flags', async () => { const { stderr, stdout } = await runServe(['--hot'], __dirname); diff --git a/test/serve/basic/webpack.config.js b/test/serve/basic/webpack.config.js index 39850bab850..98b22edfdc9 100644 --- a/test/serve/basic/webpack.config.js +++ b/test/serve/basic/webpack.config.js @@ -3,5 +3,5 @@ const WebpackCLITestPlugin = require('../../utils/webpack-cli-test-plugin'); module.exports = { mode: 'development', devtool: false, - plugins: [new WebpackCLITestPlugin(['plugins'], false)], + plugins: [new WebpackCLITestPlugin(['mode', 'plugins'], false)], };