Skip to content

Commit 18a5152

Browse files
authored
Merge pull request #29 from Realytics/fix/non-deterministic-ci
Fix - Make CI build more deterministic
2 parents 1d6320f + 8adb349 commit 18a5152

File tree

5 files changed

+106
-87
lines changed

5 files changed

+106
-87
lines changed

.eslintrc.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
"error",
99
2
1010
],
11-
"linebreak-style": [
12-
"error",
13-
"unix"
14-
],
1511
"quotes": [
1612
"error",
1713
"single"

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
"lib"
88
],
99
"scripts": {
10-
"test:unit": "NODE_ENV=test node_modules/.bin/mocha -R spec ./test/unit",
11-
"test:integration": "NODE_ENV=test node_modules/.bin/mocha -R spec ./test/integration && rimraf tmp",
10+
"test:unit": "mocha -R spec ./test/unit",
11+
"test:integration": "mocha -R spec ./test/integration && rimraf tmp",
1212
"test": "npm run test:unit && npm run test:integration",
13-
"test:watch": "NODE_ENV=test node_modules/.bin/mocha -R spec --watch ./test/unit",
14-
"test:coverage": "rimraf coverage && node_modules/.bin/istanbul cover -root lib --include-all-sources node_modules/.bin/_mocha -- -R spec ./test/unit ./test/integration",
15-
"lint": "node node_modules/.bin/eslint ./lib ./test",
16-
"lint:fix": "node node_modules/.bin/eslint ./lib ./test --fix"
13+
"test:watch": "mocha -R spec --watch ./test/unit",
14+
"test:coverage": "rimraf coverage && istanbul cover -root lib --include-all-sources node_modules/.bin/_mocha -- -R spec ./test/unit ./test/integration",
15+
"lint": "eslint ./lib ./test",
16+
"lint:fix": "eslint ./lib ./test --fix"
1717
},
1818
"repository": {
1919
"url": "https://github.com/Realytics/fork-ts-checker-webpack-plugin.git",

test/integration/index.spec.js

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ var webpack = require('webpack');
77
var ForkTsCheckerWebpackPlugin = require('../../lib/index');
88

99
describe('[INTEGRATION] index', function () {
10+
this.timeout(30000);
1011

1112
function createCompiler(options) {
1213
return webpack({
@@ -33,9 +34,38 @@ describe('[INTEGRATION] index', function () {
3334
});
3435
}
3536

36-
it('should work without configuration', function (callback) {
37-
this.timeout(5000);
37+
it('should allow to pass no options', function () {
38+
expect(function () {
39+
new ForkTsCheckerWebpackPlugin();
40+
}).to.not.throw.error;
41+
});
42+
43+
it('should detect paths', function () {
44+
var plugin = new ForkTsCheckerWebpackPlugin({ tslint: true });
45+
46+
expect(plugin.tsconfig).to.be.equal('./tsconfig.json');
47+
expect(plugin.tslint).to.be.equal('./tslint.json');
48+
});
49+
50+
it('should set logger to console by default', function () {
51+
var plugin = new ForkTsCheckerWebpackPlugin({ });
52+
53+
expect(plugin.logger).to.be.equal(console);
54+
});
55+
56+
it('should set watch to empty array by default', function () {
57+
var plugin = new ForkTsCheckerWebpackPlugin({ });
3858

59+
expect(plugin.watch).to.be.deep.equal([]);
60+
});
61+
62+
it('should set watch to one element array for string', function () {
63+
var plugin = new ForkTsCheckerWebpackPlugin({ watch: '/test' });
64+
65+
expect(plugin.watch).to.be.deep.equal(['/test']);
66+
});
67+
68+
it('should work without configuration', function (callback) {
3969
var compiler = createCompiler();
4070

4171
compiler.run(function (err, stats) {
@@ -45,8 +75,6 @@ describe('[INTEGRATION] index', function () {
4575
});
4676

4777
it('should block emit on build mode', function (callback) {
48-
this.timeout(5000);
49-
5078
var compiler = createCompiler();
5179
compiler.plugin('fork-ts-checker-emit', function () {
5280
expect(true).to.be.true;
@@ -58,8 +86,6 @@ describe('[INTEGRATION] index', function () {
5886

5987

6088
it('should not block emit on watch mode', function (callback) {
61-
this.timeout(5000);
62-
6389
var compiler = createCompiler();
6490
var watching = compiler.watch({}, function() {});
6591

@@ -88,9 +114,6 @@ describe('[INTEGRATION] index', function () {
88114
});
89115

90116
it('should find the same errors on multi-process mode', function (callback) {
91-
// set bigger timeout - it can be a little big long test
92-
this.timeout(10000);
93-
94117
var compilerA = createCompiler({ workers: 1, tslint: true });
95118
var compilerB = createCompiler({ workers: 4, tslint: true });
96119
var errorsA, errorsB, warningsA, warningsB;

test/unit/index.spec.js

Lines changed: 0 additions & 39 deletions
This file was deleted.

yarn.lock

Lines changed: 68 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,30 @@ acorn@^5.0.0, acorn@^5.0.1:
3030
version "5.0.3"
3131
resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.0.3.tgz#c460df08491463f028ccb82eab3730bf01087b3d"
3232

33-
ajv-keywords@^1.0.0, ajv-keywords@^1.1.1:
33+
ajv-keywords@^1.0.0:
3434
version "1.5.1"
3535
resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c"
3636

37+
ajv-keywords@^2.0.0:
38+
version "2.1.0"
39+
resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.0.tgz#a296e17f7bfae7c1ce4f7e0de53d29cb32162df0"
40+
3741
ajv@^4.7.0, ajv@^4.9.1:
3842
version "4.11.7"
3943
resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.7.tgz#8655a5d86d0824985cc471a1d913fb6729a0ec48"
4044
dependencies:
4145
co "^4.6.0"
4246
json-stable-stringify "^1.0.1"
4347

48+
ajv@^5.1.5:
49+
version "5.2.1"
50+
resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.2.1.tgz#dcd03045175883ba1b636e5ae9ec3df9ab85323a"
51+
dependencies:
52+
co "^4.6.0"
53+
fast-deep-equal "^1.0.0"
54+
json-schema-traverse "^0.3.0"
55+
json-stable-stringify "^1.0.1"
56+
4457
align-text@^0.1.1, align-text@^0.1.3:
4558
version "0.1.4"
4659
resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117"
@@ -650,6 +663,15 @@ enhanced-resolve@^3.0.0:
650663
object-assign "^4.0.1"
651664
tapable "^0.2.5"
652665

666+
enhanced-resolve@^3.3.0:
667+
version "3.3.0"
668+
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-3.3.0.tgz#950964ecc7f0332a42321b673b38dc8ff15535b3"
669+
dependencies:
670+
graceful-fs "^4.1.2"
671+
memory-fs "^0.4.0"
672+
object-assign "^4.0.1"
673+
tapable "^0.2.5"
674+
653675
errno@^0.1.3:
654676
version "0.1.4"
655677
resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.4.tgz#b896e23a9e5e8ba33871fc996abd3635fc9a1c7d"
@@ -865,6 +887,10 @@ [email protected]:
865887
version "1.0.2"
866888
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550"
867889

890+
fast-deep-equal@^1.0.0:
891+
version "1.0.0"
892+
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz#96256a3bc975595eb36d82e9929d060d893439ff"
893+
868894
fast-levenshtein@~2.0.4:
869895
version "2.0.6"
870896
resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
@@ -1391,6 +1417,10 @@ json-loader@^0.5.4:
13911417
version "0.5.4"
13921418
resolved "https://registry.yarnpkg.com/json-loader/-/json-loader-0.5.4.tgz#8baa1365a632f58a3c46d20175fc6002c96e37de"
13931419

1420+
json-schema-traverse@^0.3.0:
1421+
version "0.3.1"
1422+
resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340"
1423+
13941424
13951425
version "0.2.3"
13961426
resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13"
@@ -1467,16 +1497,7 @@ loader-runner@^2.3.0:
14671497
version "2.3.0"
14681498
resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.3.0.tgz#f482aea82d543e07921700d5a46ef26fdac6b8a2"
14691499

1470-
loader-utils@^0.2.16:
1471-
version "0.2.17"
1472-
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-0.2.17.tgz#f86e6374d43205a6e6c60e9196f17c0299bfb348"
1473-
dependencies:
1474-
big.js "^3.1.3"
1475-
emojis-list "^2.0.0"
1476-
json5 "^0.5.0"
1477-
object-assign "^4.0.1"
1478-
1479-
loader-utils@^1.0.2:
1500+
loader-utils@^1.0.2, loader-utils@^1.1.0:
14801501
version "1.1.0"
14811502
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.1.0.tgz#c98aef488bcceda2ffb5e2de646d6a754429f5cd"
14821503
dependencies:
@@ -2225,17 +2246,17 @@ [email protected]:
22252246
dependencies:
22262247
hoek "2.x.x"
22272248

2228-
source-list-map@^1.1.1:
2229-
version "1.1.2"
2230-
resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-1.1.2.tgz#9889019d1024cce55cdc069498337ef6186a11a1"
2249+
source-list-map@^2.0.0:
2250+
version "2.0.0"
2251+
resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.0.tgz#aaa47403f7b245a92fbc97ea08f250d6087ed085"
22312252

22322253
source-map@^0.4.4:
22332254
version "0.4.4"
22342255
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b"
22352256
dependencies:
22362257
amdefine ">=0.0.4"
22372258

2238-
source-map@^0.5.3, source-map@~0.5.1, source-map@~0.5.3:
2259+
source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1, source-map@~0.5.3:
22392260
version "0.5.6"
22402261
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412"
22412262

@@ -2493,7 +2514,7 @@ typescript@^2.1.0:
24932514
version "2.3.2"
24942515
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.3.2.tgz#f0f045e196f69a72f06b25fd3bd39d01c3ce9984"
24952516

2496-
uglify-js@^2.6, uglify-js@^2.8.27:
2517+
uglify-js@^2.6:
24972518
version "2.8.27"
24982519
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.27.tgz#47787f912b0f242e5b984343be8e35e95f694c9c"
24992520
dependencies:
@@ -2502,10 +2523,27 @@ uglify-js@^2.6, uglify-js@^2.8.27:
25022523
optionalDependencies:
25032524
uglify-to-browserify "~1.0.0"
25042525

2526+
uglify-js@^2.8.29:
2527+
version "2.8.29"
2528+
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd"
2529+
dependencies:
2530+
source-map "~0.5.1"
2531+
yargs "~3.10.0"
2532+
optionalDependencies:
2533+
uglify-to-browserify "~1.0.0"
2534+
25052535
uglify-to-browserify@~1.0.0:
25062536
version "1.0.2"
25072537
resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7"
25082538

2539+
uglifyjs-webpack-plugin@^0.4.6:
2540+
version "0.4.6"
2541+
resolved "https://registry.yarnpkg.com/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-0.4.6.tgz#b951f4abb6bd617e66f63eb891498e391763e309"
2542+
dependencies:
2543+
source-map "^0.5.6"
2544+
uglify-js "^2.8.29"
2545+
webpack-sources "^1.0.1"
2546+
25092547
uid-number@^0.0.6:
25102548
version "0.0.6"
25112549
resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81"
@@ -2564,37 +2602,38 @@ watchpack@^1.3.1:
25642602
chokidar "^1.4.3"
25652603
graceful-fs "^4.1.2"
25662604

2567-
webpack-sources@^0.2.3:
2568-
version "0.2.3"
2569-
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-0.2.3.tgz#17c62bfaf13c707f9d02c479e0dcdde8380697fb"
2605+
webpack-sources@^1.0.1:
2606+
version "1.0.1"
2607+
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.0.1.tgz#c7356436a4d13123be2e2426a05d1dad9cbe65cf"
25702608
dependencies:
2571-
source-list-map "^1.1.1"
2609+
source-list-map "^2.0.0"
25722610
source-map "~0.5.3"
25732611

2574-
webpack@^2.0.0:
2575-
version "2.6.1"
2576-
resolved "https://registry.yarnpkg.com/webpack/-/webpack-2.6.1.tgz#2e0457f0abb1ac5df3ab106c69c672f236785f07"
2612+
webpack@^3.0.0:
2613+
version "3.1.0"
2614+
resolved "https://registry.yarnpkg.com/webpack/-/webpack-3.1.0.tgz#ac0675e500db835f9ab2369d29ba096f51ad0731"
25772615
dependencies:
25782616
acorn "^5.0.0"
25792617
acorn-dynamic-import "^2.0.0"
2580-
ajv "^4.7.0"
2581-
ajv-keywords "^1.1.1"
2618+
ajv "^5.1.5"
2619+
ajv-keywords "^2.0.0"
25822620
async "^2.1.2"
2583-
enhanced-resolve "^3.0.0"
2621+
enhanced-resolve "^3.3.0"
2622+
escope "^3.6.0"
25842623
interpret "^1.0.0"
25852624
json-loader "^0.5.4"
25862625
json5 "^0.5.1"
25872626
loader-runner "^2.3.0"
2588-
loader-utils "^0.2.16"
2627+
loader-utils "^1.1.0"
25892628
memory-fs "~0.4.1"
25902629
mkdirp "~0.5.0"
25912630
node-libs-browser "^2.0.0"
25922631
source-map "^0.5.3"
25932632
supports-color "^3.1.0"
25942633
tapable "~0.2.5"
2595-
uglify-js "^2.8.27"
2634+
uglifyjs-webpack-plugin "^0.4.6"
25962635
watchpack "^1.3.1"
2597-
webpack-sources "^0.2.3"
2636+
webpack-sources "^1.0.1"
25982637
yargs "^6.0.0"
25992638

26002639
which-module@^1.0.0:

0 commit comments

Comments
 (0)