@@ -19,6 +19,8 @@ jasmine.getEnv().defaultTimeoutInterval = 30000;
19
19
function setUpCompiler ( htmlWebpackPlugin ) {
20
20
spyOn ( htmlWebpackPlugin , 'evaluateCompilationResult' ) . and . callThrough ( ) ;
21
21
var webpackConfig = {
22
+ // Caching works only in development
23
+ mode : 'development' ,
22
24
entry : path . join ( __dirname , 'fixtures/index.js' ) ,
23
25
output : {
24
26
path : OUTPUT_DIR ,
@@ -53,6 +55,7 @@ describe('HtmlWebpackPluginCaching', function () {
53
55
} ) ;
54
56
var childCompilerHash ;
55
57
var compiler = setUpCompiler ( htmlWebpackPlugin ) ;
58
+ compiler . addTestFile ( path . join ( __dirname , 'fixtures/index.js' ) ) ;
56
59
compiler . run ( )
57
60
// Change the template file and compile again
58
61
. then ( function ( ) {
@@ -77,6 +80,7 @@ describe('HtmlWebpackPluginCaching', function () {
77
80
var htmlWebpackPlugin = new HtmlWebpackPlugin ( ) ;
78
81
var compiler = setUpCompiler ( htmlWebpackPlugin ) ;
79
82
var childCompilerHash ;
83
+ compiler . addTestFile ( path . join ( __dirname , 'fixtures/index.js' ) ) ;
80
84
compiler . run ( )
81
85
// Change a js file and compile again
82
86
. then ( function ( ) {
@@ -104,6 +108,7 @@ describe('HtmlWebpackPluginCaching', function () {
104
108
} ) ;
105
109
var childCompilerHash ;
106
110
var compiler = setUpCompiler ( htmlWebpackPlugin ) ;
111
+ compiler . addTestFile ( path . join ( __dirname , 'fixtures/index.js' ) ) ;
107
112
compiler . run ( )
108
113
// Change a js file and compile again
109
114
. then ( function ( ) {
@@ -132,7 +137,7 @@ describe('HtmlWebpackPluginCaching', function () {
132
137
} ) ;
133
138
var childCompilerHash ;
134
139
var compiler = setUpCompiler ( htmlWebpackPlugin ) ;
135
- compiler . simulateFileChange ( template , { footer : '<!-- 0 -->' } ) ;
140
+ compiler . addTestFile ( template ) ;
136
141
compiler . run ( )
137
142
// Change the template file and compile again
138
143
. then ( function ( ) {
@@ -161,8 +166,8 @@ describe('HtmlWebpackPluginCaching', function () {
161
166
template : template
162
167
} ) ;
163
168
var compiler = setUpCompiler ( htmlWebpackPlugin ) ;
164
- compiler . simulateFileChange ( template , { footer : ' ' } ) ;
165
- compiler . simulateFileChange ( jsFile , { footer : ' ' } ) ;
169
+ compiler . addTestFile ( template ) ;
170
+ compiler . addTestFile ( jsFile ) ;
166
171
// Build the template file for the first time
167
172
compiler . run ( )
168
173
// Change the template file (second build)
0 commit comments