@@ -7,6 +7,7 @@ var webpack = require('webpack');
7
7
var ForkTsCheckerWebpackPlugin = require ( '../../lib/index' ) ;
8
8
9
9
describe ( '[INTEGRATION] index' , function ( ) {
10
+ this . timeout ( 30000 ) ;
10
11
11
12
function createCompiler ( options ) {
12
13
return webpack ( {
@@ -33,9 +34,38 @@ describe('[INTEGRATION] index', function () {
33
34
} ) ;
34
35
}
35
36
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 ( { } ) ;
38
58
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 ) {
39
69
var compiler = createCompiler ( ) ;
40
70
41
71
compiler . run ( function ( err , stats ) {
@@ -45,8 +75,6 @@ describe('[INTEGRATION] index', function () {
45
75
} ) ;
46
76
47
77
it ( 'should block emit on build mode' , function ( callback ) {
48
- this . timeout ( 5000 ) ;
49
-
50
78
var compiler = createCompiler ( ) ;
51
79
compiler . plugin ( 'fork-ts-checker-emit' , function ( ) {
52
80
expect ( true ) . to . be . true ;
@@ -58,8 +86,6 @@ describe('[INTEGRATION] index', function () {
58
86
59
87
60
88
it ( 'should not block emit on watch mode' , function ( callback ) {
61
- this . timeout ( 5000 ) ;
62
-
63
89
var compiler = createCompiler ( ) ;
64
90
var watching = compiler . watch ( { } , function ( ) { } ) ;
65
91
@@ -88,9 +114,6 @@ describe('[INTEGRATION] index', function () {
88
114
} ) ;
89
115
90
116
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
-
94
117
var compilerA = createCompiler ( { workers : 1 , tslint : true } ) ;
95
118
var compilerB = createCompiler ( { workers : 4 , tslint : true } ) ;
96
119
var errorsA , errorsB , warningsA , warningsB ;
0 commit comments