Skip to content

Commit

Permalink
test: create additional tests for #mkdtempSync
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath committed Jul 7, 2019
1 parent ab248b4 commit 166935d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/__tests__/volume.test.ts
Expand Up @@ -926,6 +926,14 @@ describe('volume', () => {
vol.writeFileSync(name + '/file.txt', 'lol');
expect(vol.toJSON()).toEqual({ [name + '/file.txt']: 'lol' });
});
it('throws when prefix is not a string', () => {
const vol = new Volume();
expect(() => vol.mkdtempSync({} as string)).toThrow(TypeError);
});
it('throws when prefix contains null bytes', () => {
const vol = new Volume();
expect(() => vol.mkdtempSync('/tmp-\u0000')).toThrow(/path.+string.+null bytes/i);
});
});
describe('.mkdtemp(prefix[, options], callback)', () => {
xit('Create temp dir at root', () => {});
Expand Down

0 comments on commit 166935d

Please sign in to comment.