Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should write content to a file', async () => {
await write('test/foo.txt', 'FOO', '/target/dir');
expect(mkdirp)
.toBeCalled();
expect(mkdirp.__getDirs())
.toContain('/target/dir/test');
expect(fs.writeFile)
.toBeCalled();
expect(fs.__getFiles())
.toEqual({ '/target/dir/test/foo.txt': 'FOO' });
});
});