Open aMOPel opened 1 year ago
I'm also seeing "No tests found" but I think this might be a recent regression, this was working fine just a couple of weeks ago!
Yep, as I thought, if I pin the version to this commit: 3853b842b5d4850a2d5495f75802dabb3cda246c
then it works fine. Curious to know if that helps you
Probably a duplicate of #60. The problem is commit 0c0dad7 updated the detection logic so that jest
has to appear in the dependencies/devDependencies of the package.json, otherwise it will refuse to detect any tests.
Curious to know if that helps you
~/.local/share/nvim/site/pack/packer/start/neotest-jest $ git status
HEAD detached at 3853b84
nothing to commit, working tree clean
:lua require('neotest').run.run({env={NODE_ENV='test'}, jestConfigFile='./test/jest-e2e.json'})<cr>
in test/app/app.e2e-spec.ts
still produces "No tests found".
I had to take it back a few commits before the dependency logic was added. Try commit 219033658bf8de6b91e201036a5cc5456905d9d2
. In my case my package.json looks like"
"devDependencies": {
...
"@types/jest": "^27.4.1",
...
},
@haydenmeade what's the rationale for locking this down so tightly?
I have the same issue. It just ignores .e2e-spec.ts but works fine with .spec.ts
I've added a related PR https://github.com/nvim-neotest/neotest-jest/pull/92. Ideally, it should be a configurable list of prefixes.
Problem:
I can't figure out how to configure this.
Plugin Setup:
All dependencies installed.
Setup Call
Project Setup:
Unit Tests:
Jest config is in
package.json
Test files are in
src/*.spec.ts
Normal test cases work, eg
<Cmd>lua require('neotest').run.run()<CR>
insrc/app.controller.spec.ts
e2e tests:
Jest config is in
test/jest-e2e.json
Test files are in
test/app/app.e2e-spec.ts
Running tests with cli works:
NODE_ENV=test jest --config ./test/jest-e2e.json
Running tests with neotest doesn't work::lua require('neotest').run.run({env={NODE_ENV='test'}, jestConfigFile='./test/jest-e2e.json'})<cr>
intest/app/app.e2e-spec.ts
produces "No tests found".Thank you for your work!