Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ava-playback should create playback dir if it doesn't exist #8

Open
johanbrook opened this issue Nov 29, 2017 · 3 comments
Open

Ava-playback should create playback dir if it doesn't exist #8

johanbrook opened this issue Nov 29, 2017 · 3 comments

Comments

@johanbrook
Copy link

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.

@dempfi
Copy link
Owner

dempfi commented Nov 30, 2017

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.

@johanbrook
Copy link
Author

No worries :) Good to catch these edge cases.

@taylorjdawson
Copy link
Contributor

I'm guessing this issue could be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants