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 expect
match between my unit tests and my step definitions (I don't want to.equal
in my step definitions and toEqual
in my unit tests).
How can i do this? After some digging, Jest seems to rely on the expect
npm 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.js
separately from my tester Jest.
source
share