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

Valid test in code/test.js, but npm test code/test.js results in "Couldn’t find any files to test" #2454

Closed
alberto56 opened this issue Apr 13, 2020 · 1 comment
Labels

Comments

@alberto56
Copy link

Please provide details about:

  • What you're trying to do

Run a test in /app/code/test.js

  • Why you can't use AVA for this

Regardless of how I try this, I always get "Couldn’t find any files to test"

root@7d5a158f4fef:/app# cat package.json 
{
	"name": "docker-ava",
	"scripts": {
		"test": "ava"
	},
	"devDependencies": {
		"ava": "*"
	}
}
root@7d5a158f4fef:/app# ls -lah code         
total 8.0K
drwxr-xr-x 3 root root   96 Mar 13  2017 .
drwxr-xr-x 1 root root 4.0K Apr 13 15:26 ..
-rw-r--r-- 1 root root   82 Mar 13  2017 test.js
root@7d5a158f4fef:/app# npm test *    

> docker-ava@ test /app
> ava "code" "node_modules" "package-lock.json" "package.json"


  ✖ Couldn’t find any files to test

npm ERR! Test failed.  See above for more details.
root@7d5a158f4fef:/app# npm test */test.js

> docker-ava@ test /app
> ava "code/test.js"


  ✖ Couldn’t find any files to test

npm ERR! Test failed.  See above for more details.
root@7d5a158f4fef:/app# npm test code/test.js

> docker-ava@ test /app
> ava "code/test.js"


  ✖ Couldn’t find any files to test

npm ERR! Test failed.  See above for more details.
root@7d5a158f4fef:/app# npm test /app/code/test.js

> docker-ava@ test /app
> ava "/app/code/test.js"


  ✖ Couldn’t find any files to test

npm ERR! Test failed.  See above for more details.
root@7d5a158f4fef:/app# npx ava

  ✖ Couldn’t find any files to test

root@7d5a158f4fef:/app# 
  • And maybe how you think AVA could handle this

I am aware of issue #2373, so I know eventually AVA will tell me what I'm doing wrong. However, for now I'd like some feedback from the maintainers to guide me in the right direction.

@alberto56
Copy link
Author

Ahhh, just saw I need to specify my test files in configuration. Works now.

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

No branches or pull requests

1 participant