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

Feature Request: Choose filename for snapshots file #405

Open
rkoval opened this issue Aug 9, 2019 · 2 comments
Open

Feature Request: Choose filename for snapshots file #405

rkoval opened this issue Aug 9, 2019 · 2 comments

Comments

@rkoval
Copy link

rkoval commented Aug 9, 2019

Hello!

First off, I'd like to say that this project is excellent. I'm really excited to add the power of jest snapshots using a mocha runner.

The feature I'm wanting seems like trivial enough, but please advise if not. I'm basically just wanting an argument to pass to snapshot that allows for a manual filename/location to specify to save snapshots.

The reasoning for this is because we use webpack for our tests, so the entrypoint for all (we have thousands) of them is a single tests.js file outputted by webpack outputs as a single transpiled artifact. I tried using useRelativePath in my package.json, but that also doesn't seem to give the functionality I'm requiring.

And... that's it. Please let me know what your thoughts are!

@rohit-gohri
Copy link

Another slightly different usecase for this would be splitting current snapshot files into multiple ones. I have a a single test runner file that imports test configs from different files and runs them from a single file so all their snapshots gets saved together even though they are unrelated. An option to specify save file would be great.

My team developed a feature similar to this for our internal use, to append a suffix to the test file, didn't think that would be helpful to others. That can be easily modified to take full name as input. I'll try to get a PR opened after separating that code.

@rohit-gohri
Copy link

@bahmutov #435 was opened by my colleague @sethiyark for this. What is your opinion on this and the possible solution?

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

2 participants