Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Feb 14, 2021
1 parent b819ef3 commit e01d796
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
29 changes: 15 additions & 14 deletions test/cli/cli.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,7 @@ const internalIp = require('internal-ip');
const testBin = require('../helpers/test-bin');
const isWebpack5 = require('../helpers/isWebpack5');

// skip if webpack-dev-server is not linked
let runCLITest = describe;

try {
basePath = path.join(require.resolve('webpack-dev-server'), '..', '..');
} catch {
runCLITest = describe.skip;
}

runCLITest('CLI', () => {
describe('CLI', () => {
const webpack4Test = isWebpack5 ? it.skip : it;
const webpack5Test = isWebpack5 ? it : it.skip;

Expand All @@ -40,20 +31,30 @@ runCLITest('CLI', () => {
});

webpack5Test('--hot webpack 5', (done) => {
testBin('--hot', path.resolve(__dirname, '../fixtures/cli/verbose-config.js'))
testBin(
'--hot',
path.resolve(__dirname, '../fixtures/cli/verbose-config.js')
)
.then((output) => {
expect(output.exitCode).toEqual(0);
expect(output.stderr).toContain('webpack/runtime/hot module replacement');
expect(output.stderr).toContain(
'webpack/runtime/hot module replacement'
);
done();
})
.catch(done);
});

webpack5Test('--no-hot webpack 5', (done) => {
testBin('--no-hot', path.resolve(__dirname, '../fixtures/cli/verbose-config.js'))
testBin(
'--no-hot',
path.resolve(__dirname, '../fixtures/cli/verbose-config.js')
)
.then((output) => {
expect(output.exitCode).toEqual(0);
expect(output.stderr).not.toContain('webpack/runtime/hot module replacement');
expect(output.stderr).not.toContain(
'webpack/runtime/hot module replacement'
);
done();
})
.catch(done);
Expand Down
8 changes: 5 additions & 3 deletions test/fixtures/cli/verbose-config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
'use strict';

module.exports = {
stats: 'verbose',
mode: 'development'
}
stats: 'verbose',
mode: 'development',
};

0 comments on commit e01d796

Please sign in to comment.