amiceli / vitest-cucumber

Use gherkin in your unit tests with vitest
https://vitest-cucumber.miceli.click
25 stars 2 forks source link

Error on test file save #78

Open charlieforward9 opened 1 month ago

charlieforward9 commented 1 month ago

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.

image

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:

image

amiceli commented 1 month ago

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") ?

charlieforward9 commented 1 month ago

I use the path relative to the root of the repository. I also use the singular loadFeature method.

Ex. loadFeature("src/....../test.feature")

amiceli commented 1 month ago

Ok, I found the bug, I'm working on it.

amiceli commented 1 month ago

@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.

charlieforward9 commented 1 month ago

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!

amiceli commented 1 month ago

Ok, we can forget bug I found ;) If feature file not found fix is ok for you, I'll close this issue.

charlieforward9 commented 1 month ago

Both myself and @sainaruufl experienced this error in 3.3.1-beta.2

amiceli commented 1 month ago

You still have file not found error in vitest VsCode ?

charlieforward9 commented 1 month ago

Yes, we have not updated our version since 3.3.1-beta.2 and still see this.