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

Nest test dirs under a root #883

Closed
rotu opened this issue Sep 8, 2023 · 2 comments
Closed

Nest test dirs under a root #883

rotu opened this issue Sep 8, 2023 · 2 comments

Comments

@rotu
Copy link

rotu commented Sep 8, 2023

Test fixture directories are named tap-testdir-something but snapshots are under a tap-snapshots/path/to/test. It may make more sense to move the test fixtures to some tap-testdir/ root and maybe to allow it to be outside the repository root.

This would allow easier manual cleanup (especially after running with --save-fixture) and make it easier to configure tools that have file system watchers.

originally mentioned here npm/template-oss#348 (comment)

@isaacs
Copy link
Member

isaacs commented Sep 8, 2023

Hm, that's a pretty good idea.

Snapshots were always kept in a single root location, because the expectation is that they'll stick around and get checked into git. Fixture dirs are usually transient, so it doesn't usually much matter where they are, but putting them outside the test root (like in /tmp or something) often fails in CI environments that don't have write access to any other paths.

In any event, it's just a change to the #getTestdir method here: https://github.com/tapjs/tapjs/blob/main/src/fixture/src/index.ts#L130-L155 and you would still be able to override it with a config option if you wanted.

@isaacs isaacs closed this as completed in a5dc854 Sep 10, 2023
@rotu
Copy link
Author

rotu commented Sep 11, 2023

WOOHOO! I'll get off your lawn now :-)

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