@@ -35,7 +35,7 @@ describe('webpack preprocessor', function () {
3535 toJson ( ) { return { warnings : [ ] , errors : [ ] } } ,
3636 }
3737
38- this . config = {
38+ this . file = {
3939 filePath : 'path/to/file.js' ,
4040 outputPath : 'output/output.js' ,
4141 shouldWatch : false ,
@@ -50,7 +50,7 @@ describe('webpack preprocessor', function () {
5050 }
5151
5252 this . run = ( ) => {
53- return preprocessor ( this . options ) ( this . config )
53+ return preprocessor ( this . options ) ( this . file )
5454 }
5555 } )
5656
@@ -67,7 +67,7 @@ describe('webpack preprocessor', function () {
6767
6868 describe ( 'preprocessor function' , function ( ) {
6969 afterEach ( function ( ) {
70- this . config . on . withArgs ( 'close' ) . yield ( ) // resets the cached bundles
70+ this . file . on . withArgs ( 'close' ) . yield ( ) // resets the cached bundles
7171 } )
7272
7373 describe ( 'when it finishes cleanly' , function ( ) {
@@ -86,14 +86,14 @@ describe('webpack preprocessor', function () {
8686 webpack . returns ( this . compilerApi )
8787
8888 const run = preprocessor ( this . options )
89- run ( this . config )
90- run ( this . config )
89+ run ( this . file )
90+ run ( this . file )
9191 expect ( webpack ) . to . be . calledOnce
9292 } )
9393
9494 it ( 'specifies the entry file' , function ( ) {
9595 return this . run ( ) . then ( ( ) => {
96- expect ( webpack . lastCall . args [ 0 ] . entry ) . to . equal ( this . config . filePath )
96+ expect ( webpack . lastCall . args [ 0 ] . entry ) . to . equal ( this . file . filePath )
9797 } )
9898 } )
9999
@@ -113,15 +113,15 @@ describe('webpack preprocessor', function () {
113113 } )
114114
115115 it ( 'watches when shouldWatch is true' , function ( ) {
116- this . config . shouldWatch = true
116+ this . file . shouldWatch = true
117117 this . compilerApi . watch . yields ( null , this . statsApi )
118118 return this . run ( ) . then ( ( ) => {
119119 expect ( this . compilerApi . watch ) . to . be . called
120120 } )
121121 } )
122122
123123 it ( 'includes watchOptions if provided' , function ( ) {
124- this . config . shouldWatch = true
124+ this . file . shouldWatch = true
125125 this . compilerApi . watch . yields ( null , this . statsApi )
126126 this . options . watchOptions = { poll : true }
127127 return this . run ( ) . then ( ( ) => {
@@ -133,29 +133,29 @@ describe('webpack preprocessor', function () {
133133
134134 it ( 'resolves with the output path' , function ( ) {
135135 return this . run ( ) . then ( ( outputPath ) => {
136- expect ( outputPath ) . to . be . equal ( this . config . outputPath )
136+ expect ( outputPath ) . to . be . equal ( this . file . outputPath )
137137 } )
138138 } )
139139
140140 it ( 'emits `rerun` when there is an update' , function ( ) {
141141 this . compilerApi . plugin . withArgs ( 'compile' ) . yields ( )
142142 return this . run ( ) . then ( ( ) => {
143- expect ( this . config . emit ) . to . be . calledWith ( 'rerun' )
143+ expect ( this . file . emit ) . to . be . calledWith ( 'rerun' )
144144 } )
145145 } )
146146
147147 it ( 'closes bundler when shouldWatch is true and `close` is emitted' , function ( ) {
148- this . config . shouldWatch = true
148+ this . file . shouldWatch = true
149149 this . compilerApi . watch . yields ( null , this . statsApi )
150150 return this . run ( ) . then ( ( ) => {
151- this . config . on . withArgs ( 'close' ) . yield ( )
151+ this . file . on . withArgs ( 'close' ) . yield ( )
152152 expect ( this . watchApi . close ) . to . be . called
153153 } )
154154 } )
155155
156156 it ( 'does not close bundler when shouldWatch is false and `close` is emitted' , function ( ) {
157157 return this . run ( ) . then ( ( ) => {
158- this . config . on . withArgs ( 'close' ) . yield ( )
158+ this . file . on . withArgs ( 'close' ) . yield ( )
159159 expect ( this . watchApi . close ) . not . to . be . called
160160 } )
161161 } )
0 commit comments