@@ -13,17 +13,6 @@ test('throws error without opts.manifest string', t => {
1313 t . is ( error . message , '`manifest` property is required' ) ;
1414} ) ;
1515
16- test ( 'throws error with opts.prepend non-string with old format' , t => {
17- const manifest = path . join ( __dirname , 'fixtures' , 'old-rev-manifest.json' ) ;
18- const error = t . throws ( ( ) =>
19- manifestRev ( {
20- manifest,
21- prepend : true
22- } )
23- ) ;
24- t . is ( error . message , '`prepend` property defined, but it was not a string' ) ;
25- } ) ;
26-
2716test ( 'throws error with opts.prepend non-string with new format' , t => {
2817 const manifest = path . join ( __dirname , 'fixtures' , 'rev-manifest.json' ) ;
2918 const error = t . throws ( ( ) =>
@@ -35,59 +24,26 @@ test('throws error with opts.prepend non-string with new format', t => {
3524 t . is ( error . message , '`prepend` property defined, but it was not a string' ) ;
3625} ) ;
3726
38- test ( 'exposes manifest function with old format' , t => {
39- const manifest = path . join ( __dirname , 'fixtures' , 'old-rev-manifest.json' ) ;
40- t . true ( typeof manifestRev ( { manifest } ) === 'function' ) ;
41- } ) ;
42-
4327test ( 'exposes manifest function with new format' , t => {
4428 const manifest = path . join ( __dirname , 'fixtures' , 'rev-manifest.json' ) ;
4529 t . true ( typeof manifestRev ( { manifest } ) === 'function' ) ;
4630} ) ;
4731
48- test ( 'returns output when manifest invoked with old format' , t => {
49- const manifest = path . join ( __dirname , 'fixtures' , 'old-rev-manifest.json' ) ;
50- t . is ( manifestRev ( { manifest } ) ( 'script.js' ) , '/script-d80c4dea53.js' ) ;
51- } ) ;
52-
5332test ( 'returns output when manifest invoked with new format' , t => {
5433 const manifest = path . join ( __dirname , 'fixtures' , 'rev-manifest.json' ) ;
5534 t . is ( manifestRev ( { manifest } ) ( 'script.js' ) , '/script-d80c4dea53.js' ) ;
5635} ) ;
5736
58- test ( 'returns output of path when manifest invoked with old format' , t => {
59- const manifest = path . join ( __dirname , 'fixtures' , 'old-rev-manifest.json' ) ;
60- t . is ( manifestRev ( { manifest } ) ( 'script.js' , 'path' ) , '/script-d80c4dea53.js' ) ;
61- } ) ;
62-
6337test ( 'returns output of path when manifest invoked with new format' , t => {
6438 const manifest = path . join ( __dirname , 'fixtures' , 'rev-manifest.json' ) ;
6539 t . is ( manifestRev ( { manifest } ) ( 'script.js' , 'path' ) , '/script-d80c4dea53.js' ) ;
6640} ) ;
6741
68- test ( 'returns output of integrity when manifest invoked with old format' , t => {
69- const manifest = path . join ( __dirname , 'fixtures' , 'old-rev-manifest.json' ) ;
70- t . is (
71- manifestRev ( { manifest } ) ( 'script.js' , 'integrity' ) ,
72- '/script-d80c4dea53.js'
73- ) ;
74- } ) ;
75-
7642test ( 'returns output of integrity when manifest invoked with new format' , t => {
7743 const manifest = path . join ( __dirname , 'fixtures' , 'rev-manifest.json' ) ;
7844 t . is ( manifestRev ( { manifest } ) ( 'script.js' , 'integrity' ) , false ) ;
7945} ) ;
8046
81- test ( 'returns output of integrity when manifest invoked in PROD with old format' , t => {
82- const manifest = path . join ( __dirname , 'fixtures' , 'old-rev-manifest.json' ) ;
83- process . env . NODE_ENV = 'production' ;
84- t . is (
85- manifestRev ( { manifest } ) ( 'script.js' , 'integrity' ) ,
86- '/script-d80c4dea53.js'
87- ) ;
88- delete process . env . NODE_ENV ;
89- } ) ;
90-
9147test ( 'returns output of integrity when manifest invoked in PROD with new format' , t => {
9248 const manifest = path . join ( __dirname , 'fixtures' , 'rev-manifest.json' ) ;
9349 process . env . NODE_ENV = 'production' ;
0 commit comments