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

Properly resolve files from package.json dir. #863

Closed

Conversation

jamestalmage
Copy link
Contributor

Currently, if cwd is a subdir of the project, and you just run ava, it can fail to resolve the correct set of test files. This is fixed by changing the cwd argument passed to globby. However, it seems to me that if you are in a subdirectory, and pass glob patterns on the command line, you probably want those resolved from cwd, not magically resolved from some parent directory.

@jamestalmage
Copy link
Contributor Author

This still needs to be fixed for watch mode. I've tried to figure out how to do it / how to test it, and come to the conclusion that I want to punt that to @novemberborn!

@novemberborn novemberborn self-assigned this May 24, 2016
@jamestalmage
Copy link
Contributor Author

I think this gets even harder for watch mode because of --sources.

If they are cded into a child directory and use the --sources flag, that should probably be resolved from cwd, right? But if they don't specify --sources, then we probably want to use whatever is in package.json, and resolve from that directory? That's getting complicated.

Should we eliminate the --sources flag? I have never used it, and I don't see why you really need it. Doesn't this qualify as a static config item that should live in package.json?

@jamestalmage
Copy link
Contributor Author

Should we merge this and fix watcher in another PR? This is really just a bugfix.

@novemberborn
Copy link
Member

Probably won't have time for the next few days to look into this. There's no rush to get this out though?

👍 on removing the --sources flag. Having those be relative to the package.json seems sensible. As does overriding files through the CLI, and those being relative to the actual CWD.

@jamestalmage
Copy link
Contributor Author

jamestalmage commented May 25, 2016

No rush, other than avoiding a rebase.

@jamestalmage
Copy link
Contributor Author

I would like to merge this.

We can look into making this work for watcher later.

@jamestalmage jamestalmage changed the title [WIP]: Properly resolve files from package.json dir. Properly resolve files from package.json dir. Jun 18, 2016
@jamestalmage
Copy link
Contributor Author

closing in favor of #925 - which extracts ava-files to an external module (which already has these changes)

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

Successfully merging this pull request may close these issues.

None yet

2 participants