ava-playback
ava-playback copied to clipboard
Ava-playback should create playback dir if it doesn't exist
Hi! Great package! I just thought I'd document the first run here:
Config:
"ava": {
"require": ["ava-playback"],
"playbacks": "tests/fixtures"
}
I ran this:
api→ env NODE_ENV=test AVA_PLAYBACK=record npx ava 22:14:08
fs.js:905
return binding.mkdir(pathModule.toNamespacedPath(path),
^
Error: ENOENT: no such file or directory, mkdir '/Users/Johan/Projects/Code/stocks/api/tests/fixtures'
at Object.fs.mkdirSync (fs.js:905:18)
at Object.<anonymous> (/Users/Johan/Projects/Code/stocks/api/node_modules/ava-playback/dist/index.js:12:8)
at Module._compile (module.js:641:30)
at Object.Module._extensions..js (module.js:652:10)
at Module.load (module.js:560:32)
at tryModuleLoad (module.js:503:12)
at Function.Module._load (module.js:495:3)
at Module.require (module.js:585:17)
at require (internal/module.js:11:18)
at __dirname.forEach.x (/Users/Johan/Projects/Code/stocks/api/node_modules/ava/lib/test-worker.js:30:35)
1 exception
✖ routes/stock.test.js exited with a non-zero exit code: 1
I think it the directory/directories should be created with a mkdirp
operation if they don't exist.
Hey @johanbrook. Sorry for inconvenience. I actually didn’t think of this usecase and just used mkdir :) Anyway, I’ll fix this bug and release a new version tomorrow.
No worries :) Good to catch these edge cases.
I'm guessing this issue could be closed?