@@ -7,7 +7,7 @@ const OutputFiles = require('../lib/output-files')
77var PuppeteerToIstanbul = require ( '../lib/puppeteer-to-istanbul' )
88
99describe ( 'puppeteer-to-istanbul' , ( ) => {
10- it ( 'outputs a valid out.json file' , ( ) => {
10+ it ( 'outputs a valid out.json file, to the default location ' , ( ) => {
1111 const fixture = require ( './fixtures/two-inline.json' )
1212 const pti = PuppeteerToIstanbul ( fixture )
1313 pti . writeIstanbulFormat ( )
@@ -17,6 +17,16 @@ describe('puppeteer-to-istanbul', () => {
1717 fs . unlinkSync ( '.nyc_output/out.json' )
1818 } )
1919
20+ it ( 'outputs a valid out.json file, in the custom location' , ( ) => {
21+ const fixture = require ( './fixtures/two-inline.json' )
22+ const pti = PuppeteerToIstanbul ( fixture , { storagePath : '.nyc_output/custom' } )
23+ pti . writeIstanbulFormat ( )
24+ const content = fs . readFileSync ( '.nyc_output/custom/out.json' , 'utf8' )
25+ const jsonObject = JSON . parse ( content )
26+ should . exist ( jsonObject )
27+ fs . unlinkSync ( '.nyc_output/custom/out.json' )
28+ } )
29+
2030 it ( 'correctly sets coverage info' , ( ) => {
2131 const fixture = require ( './fixtures/two-inline.json' )
2232 const pti = PuppeteerToIstanbul ( fixture )
0 commit comments