Skip to content

Commit fccefc1

Browse files
committed
Update test
1 parent 5387d12 commit fccefc1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/existing-directory-plugin.test.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,18 @@ const fs = require('fs-extra');
44
const ExistingDirectoryPlugin = require('../index');
55

66
describe('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
});

0 commit comments

Comments
 (0)