# Install all dependencies
npm install # or:
yarn install
# Run tests and then exit immediately
npm test # or
yarn test
# Run tests in watch mode, with auto-re-run, and interactive prompt
npm test -- --watch # or
yarn test -- --watch
Let's inspect the snapshots to see what these are.
__snapshots__/math.ppty.jest.js.snap
and see what the failures are.null
.So let's fix the system under test!
math.js
, and uncomment the FIXME 1
section.u
key to update snapshots.TestCheck brings QuickCheck style property based testing to Javascript. However, it does not give you the ability to save generated test cases that have previously failed as example based tests.
Jest is a testing framework that has the ability to save and update snapshots, which are programmatically serialised test expectations.
This demo uses snapshots in a creative manner to persist (the seeds required to reproduce) failed generated test cases, thereby generating example based test cases from them - achieving the original objective, of saving the failing test cases generated from properties.
The idea for this came about from the following:
GPL-3.0