vitest-cucumber
vitest-cucumber copied to clipboard
Error on test file save
A few seconds after saving (Ctrl+S) my test file - a feature file <path> doesn't exist error shows in the Vitest VSCode test bar.
When this happens, I am unable to run the tests in the file. To reset this error state, I either have to click the Refresh Tests or Run All Tests button. If I try to run tests on the file when the error message is shown, the test does not run:
Ok, I've an idea of this bug.
Jus a question, in your test file, do you use loadFeatures with relative path ?
Like loadFeatures("../test.feature") or not relative like loadFeatures("dir/test.feature") ?
I use the path relative to the root of the repository. I also use the singular loadFeature method.
Ex. loadFeature("src/....../test.feature")
Ok, I found the bug, I'm working on it.
@charlieforward9 I publish a new beta version 3.3.1-beta.1.
I tested it in some projects, when I save tests feature file is found.
You can test it ;).
Another thing, when I update a test, for example expect(str).toContain("vue") to expect(str).not.toContain("vue").
On VsCode nothing change unless I re-run tests, both passed.
Do you have same thing ?
I think isn't due to vitest-cucumber but vitest on VsCode, but I don't know why.
Thank you, I'll take a look at it.
I never noticed this inconsistency in my code. I typically run the tests every time I make a change. Have not gotten into the habit of watching output yet.
We just onboarded @sainaruufl who will take charge of our testing development practices. He will be using this library as the default structure for our BDD (e2e) tests.
We are also using React Testing Library by default. We are exploring the interoperability of both libraries to improve our workflow.
I look forward to the future of this!
Ok, we can forget bug I found ;)
If feature file not found fix is ok for you, I'll close this issue.
Both myself and @sainaruufl experienced this error in 3.3.1-beta.2
You still have file not found error in vitest VsCode ?
Yes, we have not updated our version since 3.3.1-beta.2 and still see this.
I've rebased this bug branch. I'm testing changes about this error in vscode ;).
I tried with a new beta version 3.5.1-beta.1.
When I changes tests, for example, expect(true).toBe(false) to expect(true).toBe(true).
Vitest detect changes and I havn't an error about feature file.
Do you still have an error ?
This version required vitest >=2.0.0 ;).
I close this issue, i'll re-open if I have any feedback
@amiceli Looks like an issue similar to this arises in browser mode.