@@ -3,7 +3,7 @@ import fs from 'fs';
33import path from 'path' ;
44import nock from 'nock' ;
55
6- import validateGeneratedFile from '../validateGeneratedFile' ;
6+ import { validateMinifiedFileAtUrl } from '../validateGeneratedFile' ;
77
88const {
99 HOST ,
@@ -27,7 +27,7 @@ it('should download the target minified file, source maps, and external source f
2727 . get ( '/static/two.js' )
2828 . reply ( 200 , TWO_JS ) ;
2929
30- validateGeneratedFile ( url , report => {
30+ validateMinifiedFileAtUrl ( url , report => {
3131 // verify all mocked requests satisfied
3232 scope . done ( ) ;
3333
@@ -53,7 +53,7 @@ describe('source map location', () => {
5353 . get ( '/static/app.js.map' )
5454 . reply ( 200 , RAW_INLINE_SOURCE_MAP ) ;
5555
56- validateGeneratedFile ( url , report => {
56+ validateMinifiedFileAtUrl ( url , report => {
5757 expect ( report . errors ) . toHaveLength ( 0 ) ;
5858 done ( ) ;
5959 } ) ;
@@ -71,7 +71,7 @@ describe('source map location', () => {
7171 . get ( appPath )
7272 . reply ( 200 , fs . readFileSync ( minFilePath , 'utf-8' ) ) ;
7373
74- validateGeneratedFile ( url , report => {
74+ validateMinifiedFileAtUrl ( url , report => {
7575 expect ( report . errors ) . toHaveLength ( 0 ) ;
7676 done ( ) ;
7777 } ) ;
@@ -85,7 +85,7 @@ describe('source map location', () => {
8585 nock ( HOST )
8686 . get ( '/static/app.js.map' )
8787 . reply ( 200 , RAW_INLINE_SOURCE_MAP ) ;
88- validateGeneratedFile ( url , report => {
88+ validateMinifiedFileAtUrl ( url , report => {
8989 expect ( report . errors ) . toHaveLength ( 0 ) ;
9090 done ( ) ;
9191 } ) ;
@@ -101,7 +101,7 @@ describe('source map location', () => {
101101 . get ( '/static/app.js.map' )
102102 . reply ( 200 , RAW_INLINE_SOURCE_MAP ) ;
103103
104- validateGeneratedFile ( url , report => {
104+ validateMinifiedFileAtUrl ( url , report => {
105105 expect ( report . errors ) . toHaveLength ( 0 ) ;
106106 done ( ) ;
107107 } ) ;
@@ -118,7 +118,7 @@ describe('source map location', () => {
118118 . get ( '/static/app.js.map' )
119119 . reply ( 200 , RAW_INLINE_SOURCE_MAP ) ;
120120
121- validateGeneratedFile ( url , report => {
121+ validateMinifiedFileAtUrl ( url , report => {
122122 expect ( report . errors ) . toHaveLength ( 0 ) ;
123123 done ( ) ;
124124 } ) ;
@@ -129,7 +129,7 @@ describe('source map location', () => {
129129 . get ( appPath )
130130 . reply ( 200 , 'function(){}();' ) ;
131131
132- validateGeneratedFile ( url , report => {
132+ validateMinifiedFileAtUrl ( url , report => {
133133 expect ( report . errors ) . toHaveLength ( 1 ) ;
134134 expect ( report . errors [ 0 ] . name ) . toBe ( 'SourceMapNotFoundError' ) ;
135135 done ( ) ;
@@ -144,7 +144,7 @@ describe('http failures', () => {
144144 . socketDelay ( 5001 )
145145 . reply ( 200 , '<html></html>' ) ;
146146
147- validateGeneratedFile ( url , report => {
147+ validateMinifiedFileAtUrl ( url , report => {
148148 expect ( report . errors ) . toHaveLength ( 1 ) ;
149149 expect ( report . errors [ 0 ] . name ) . toBe ( 'ResourceTimeoutError' ) ;
150150 expect ( report . errors [ 0 ] ) . toHaveProperty (
@@ -164,7 +164,7 @@ describe('http failures', () => {
164164 . get ( '/static/app.js.map' )
165165 . socketDelay ( 5001 )
166166 . reply ( 200 , RAW_DEFAULT_SOURCE_MAP ) ;
167- validateGeneratedFile ( url , report => {
167+ validateMinifiedFileAtUrl ( url , report => {
168168 expect ( report . errors ) . toHaveLength ( 1 ) ;
169169 expect ( report . errors [ 0 ] . name ) . toBe ( 'ResourceTimeoutError' ) ;
170170 expect ( report . errors [ 0 ] ) . toHaveProperty (
@@ -180,7 +180,7 @@ describe('http failures', () => {
180180 . get ( appPath )
181181 . reply ( 401 , 'Not Authenticated' ) ;
182182
183- validateGeneratedFile ( url , report => {
183+ validateMinifiedFileAtUrl ( url , report => {
184184 expect ( report . errors ) . toHaveLength ( 1 ) ;
185185 expect ( report . errors [ 0 ] . name ) . toBe ( 'UnableToFetchMinifiedError' ) ;
186186 done ( ) ;
@@ -198,7 +198,7 @@ describe('http failures', () => {
198198 port : 1337
199199 } ) ;
200200
201- validateGeneratedFile ( url , report => {
201+ validateMinifiedFileAtUrl ( url , report => {
202202 expect ( report . errors ) . toHaveLength ( 1 ) ;
203203 expect ( report . errors [ 0 ] . name ) . toBe ( 'ConnectionRefusedError' ) ;
204204 done ( ) ;
@@ -214,7 +214,7 @@ describe('http failures', () => {
214214 . get ( '/static/app.js.map' )
215215 . reply ( 401 , 'Not Authenticated' ) ;
216216
217- validateGeneratedFile ( url , report => {
217+ validateMinifiedFileAtUrl ( url , report => {
218218 expect ( report . errors ) . toHaveLength ( 1 ) ;
219219 expect ( report . errors [ 0 ] . name ) . toBe ( 'UnableToFetchSourceMapError' ) ;
220220 done ( ) ;
@@ -232,7 +232,7 @@ describe('http failures', () => {
232232 . get ( '/static/two.js' )
233233 . reply ( 401 , 'Not authenticated' ) ;
234234
235- validateGeneratedFile ( url , report => {
235+ validateMinifiedFileAtUrl ( url , report => {
236236 // verify all mocked requests satisfied
237237 scope . done ( ) ;
238238 expect ( report . errors ) . toHaveLength ( 1 ) ;
@@ -252,7 +252,7 @@ describe('parsing failures', () => {
252252 . get ( '/static/app.js.map' )
253253 . reply ( 200 , '!@#(!*@#(*&@' ) ;
254254
255- validateGeneratedFile ( url , report => {
255+ validateMinifiedFileAtUrl ( url , report => {
256256 expect ( report . errors ) . toHaveLength ( 1 ) ;
257257 expect ( report . errors [ 0 ] . name ) . toBe ( 'InvalidJSONError' ) ;
258258 expect ( report . errors [ 0 ] ) . toHaveProperty (
@@ -272,7 +272,7 @@ describe('parsing failures', () => {
272272 . get ( '/static/app.js.map' )
273273 . reply ( 200 , '{"version":"3"}' ) ;
274274
275- validateGeneratedFile ( url , report => {
275+ validateMinifiedFileAtUrl ( url , report => {
276276 expect ( report . errors ) . toHaveLength ( 1 ) ;
277277 expect ( report . errors [ 0 ] . name ) . toBe ( 'InvalidSourceMapFormatError' ) ;
278278 expect ( report . errors [ 0 ] ) . toHaveProperty (
@@ -296,7 +296,7 @@ describe('content failures', () => {
296296 . get ( '/static/two.js' )
297297 . reply ( 200 , ' \n\n\n<!DOCTYPE html><html>lol</html>' ) ;
298298
299- validateGeneratedFile ( url , report => {
299+ validateMinifiedFileAtUrl ( url , report => {
300300 scope . done ( ) ;
301301 expect ( report . errors ) . toHaveLength ( 1 ) ;
302302 expect ( report . errors [ 0 ] . name ) . toBe ( 'BadContentError' ) ;
@@ -327,7 +327,7 @@ describe('mappings', () => {
327327 . get ( '/static/add.inlineSources.js.map' )
328328 . reply ( 200 , fs . readFileSync ( mapFilePath , 'utf-8' ) ) ;
329329
330- validateGeneratedFile ( url , report => {
330+ validateMinifiedFileAtUrl ( url , report => {
331331 expect ( report . errors ) . toHaveLength ( 0 ) ;
332332 done ( ) ;
333333 } ) ;
@@ -349,7 +349,7 @@ describe('mappings', () => {
349349 . get ( '/static/add.fuzzLines.js.map' )
350350 . reply ( 200 , fs . readFileSync ( mapFilePath , 'utf-8' ) ) ;
351351
352- validateGeneratedFile ( url , report => {
352+ validateMinifiedFileAtUrl ( url , report => {
353353 expect ( report . errors ) . not . toHaveLength ( 0 ) ;
354354 expect ( report . errors [ 0 ] . name ) . toBe ( 'BadTokenError' ) ;
355355 expect ( report . errors [ 0 ] ) . toHaveProperty (
@@ -376,7 +376,7 @@ describe('mappings', () => {
376376 . get ( '/static/add.fuzzColumns.js.map' )
377377 . reply ( 200 , fs . readFileSync ( mapFilePath , 'utf-8' ) ) ;
378378
379- validateGeneratedFile ( url , report => {
379+ validateMinifiedFileAtUrl ( url , report => {
380380 expect ( report . warnings ) . not . toHaveLength ( 0 ) ;
381381 expect ( report . warnings [ 0 ] . name ) . toBe ( 'BadColumnError' ) ;
382382 expect ( report . warnings [ 0 ] ) . toHaveProperty (
0 commit comments