Skip to content

Commit

Permalink
adding test for dependency lock-down
Browse files Browse the repository at this point in the history
  • Loading branch information
shellscape committed Jan 9, 2018
1 parent 3e220fe commit 6689cb8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
"mocha-sinon": "^2.0.0",
"pug": "^2.0.0-beta5",
"pug-loader": "^2.3.0",
"semver": "^5.4.1",
"should": "^13.2.0",
"sinon": "^4.1.3",
"style-loader": "^0.19.1",
Expand Down
33 changes: 20 additions & 13 deletions test/cli.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,29 @@
const assert = require('assert');
const path = require('path');
const execa = require('execa');
const semver = require('semver');
const pkg = require('../package.json');
const runDevServer = require('./helpers/run-webpack-dev-server');

describe('CLI Dependencies', () => {
it('should lock down certain dependencies', () => {
const yargs = pkg.dependencies.yargs;
// yargs needs to be locked down to 6.6.0
semver.satisfies(yargs, '6.6.0');
});
});

describe('CLI', () => {
it('--progress', (done) => {
runDevServer('--progress')
.then((output) => {
assert(output.code === 0);
assert(output.stderr.indexOf('0% compiling') >= 0);
done();
})
.catch(done);
}).timeout(6000);

describe('SIGINT', () => {
it('should exit the process when SIGINT is detected', (done) => {
const cliPath = path.resolve(__dirname, '../bin/webpack-dev-server.js');
const examplePath = path.resolve(__dirname, '../examples/cli/public');
Expand All @@ -28,15 +47,3 @@ describe('SIGINT', () => {
});
}).timeout(6000);
});

describe('CLI', () => {
it('--progress', (done) => {
runDevServer('--progress')
.then((output) => {
assert(output.code === 0);
assert(output.stderr.indexOf('0% compiling') >= 0);
done();
})
.catch(done);
}).timeout(6000);
});

0 comments on commit 6689cb8

Please sign in to comment.