I use Jest for my unit tests, and I'm going into the Cucumber.js integration process to run specifications written in Gherkin.
Everything is set up for me and it works, but I ran into one problem: how can I use Jest expect? I could use it chai, but I would like the syntax to expectmatch between my unit tests and my step definitions (I don't want to.equalin my step definitions and toEqualin my unit tests).
How can i do this? After some digging, Jest seems to rely on the expectnpm package . I could explicitly depend on this package in mine package.json, but I would rather use my existing Jest dependency. It may not be possible, but I hope so.
Another option would be to somehow fulfill the Gherkin specifications with the Jest tester. I would be open to this option. I am currently launching them, calling cucumber.jsseparately from my tester Jest.
source
share