directory-snapshot
v0.0.5
Published
Serialize contents of a directory for snapshot testing
Downloads
6
Readme
directory-snapshot
Given any directory, reads all files into memory so that it can be serialized as a snapshot (Jest or Ava). Useful for testing tools that write to the file system.
Use
import { execSync } from 'child_process';
import { dss } from 'directory-snapshot';
test('creates a new project', () => {
execSync('my-tool-that-writes-to-fs new-project');
expect(dss('./new-project')).toMatchSnapshot();
});
Install
yarn add directory-snapshot
License
MIT