AVA Spec is meant to be installed next to AVA, so please follow its installation instructions first.
ava-spec as a development dependency:
$ npm install --save-dev ava-spec
You still run tests with
ava command. The only thing that changes are tests themselves.
First of all, you can use
ava-spec as a drop-in for ava:
Jasmine-like DSL is supported:
Or write cucumber-like scenarios:
Or just group tests together:
Last but not least you can pass groups around in fun ways:
const subject = test;;
- AVA Spec can be used to just group some tests ✔ AVA Spec is 100% compatible with ava ✔ AVA Spec can look almost like jasmine - AVA Spec supports all chaining modifiers! ✔ Cash withdrawal. Not enough money in ATM ✔ You do not need to use callbacks! 4 tests passed 1 test skipped 1 test todo
AVA spec allows you to define test groups using 3 equivalent methods:
A group title.
It is called by AVA Spec with modified AVA instance as so:
Currently AVA Spec doesn't support per-group hooks. It's a feature planned for 1.1.0.
|Adam Stankiewicz||Become co-author!|