File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -4,15 +4,18 @@ const fs = require('fs-extra');
44const ExistingDirectoryPlugin = require ( '../index' ) ;
55
66describe ( 'Existing Directory Plugin' , ( ) => {
7- after ( 'remove saved index.html from test directory' , ( ) => fs . removeSync ( 'directory-to-test/index.html' ) ) ;
7+ const directory = __dirname + '/directory-for-test' ;
8+ const filename = directory + '/index.html' ;
9+
10+ after ( 'remove saved index.html from test directory' , ( ) => fs . removeSync ( filename ) ) ;
811
912 it ( 'should save file to existing directory' , async ( ) => {
1013 const result = await scrape ( {
1114 urls : [ 'http://example.com' ] ,
12- directory : ' directory-to-test' ,
15+ directory : directory ,
1316 plugins : [ new ExistingDirectoryPlugin ( ) ]
1417 } ) ;
1518
16- expect ( fs . existsSync ( 'directory-to-test/index.html' ) ) . to . eql ( true ) ;
19+ expect ( fs . existsSync ( filename ) ) . to . eql ( true ) ;
1720 } ) ;
1821} ) ;
You can’t perform that action at this time.
0 commit comments