jest-cucumber icon indicating copy to clipboard operation
jest-cucumber copied to clipboard

Integration tests

Open bencompton opened this issue 3 years ago • 7 comments

While the examples are useful as E2E tests, they alone don't provide adequate test coverage, so integration tests are needed. Most of the logic in Jest Cucumber can be integration tested by eliminating Jest and dependency injecting a mock test runner. The following has been done so far as part of this effort:

  • Added ability to dependency inject either Jest, a mock test runner, or another test runner like Mocha
  • Implemented a mock test runner
  • Created a specs directory with feature files and step definitions. Feature file with rules / scenarios are in place to cover almost all of the library, but steps for many scenarios are still missing in the feature files, and step definition code for many of the scenarios are still a WIP
  • Introduced GitHub actions to run the tests on every commit and on PRs

Feature file automation progress

  • [ ] docstring-step-arguments
  • [x] step-execution
  • [x] step-matching
  • [x] table-step-arguments
  • [ ] auto-bind-steps
  • [ ] backgrounds
  • [ ] defining-rules-and-scenarios
  • [ ] scenario-outlines
  • [ ] spoken-languages
  • [ ] tag-filtering
  • [x] validation-and-code-generation

bencompton avatar Jan 21 '22 03:01 bencompton

I'm using latest jest-cucumber from master branch and can confirm I'm able to inject Vitest using createDefineFeature!

thelinuxlich avatar Mar 03 '23 21:03 thelinuxlich

@thelinuxlich Could you share the steps you took for this? 🙏🏻

halvardssm avatar Mar 06 '23 21:03 halvardssm

@halvardssm sure, look at this repo, I've created an example demonstrating it: https://github.com/thelinuxlich/svelte-atdd-vitest-playwright

thelinuxlich avatar Mar 07 '23 00:03 thelinuxlich

Hello @bencompton,

Would it be possible to take stock of the situation quickly? To find out what still needs to be done, unless you confirm that it is already up to date.

You could also pin this issue and add a 'work-in-progress' label, so that each contributor can see what remains to be done, and indicate here what they are working on to improve the test coverage.

pplancq avatar Mar 26 '24 09:03 pplancq

@pplancq - I'm planning to work on this incrementally over the next several days until test coverage is where it needs to be. This can happen in parallel with other work, though.

bencompton avatar Mar 26 '24 13:03 bencompton

@bencompton didn't hesitate to put the work-in-progress label to prevent the stale workflow from closing this exit.

pplancq avatar Apr 04 '24 06:04 pplancq

@bencompton any news here, maybe a PR to rely on. I checked the code that was supposed to be found on master but now we have main branch and the signature of createDefineFeature does not seem to allow injecting anything in there.

kornicameister avatar Apr 25 '24 20:04 kornicameister