Name: with-fixtures
Owner: npm
Description: null
Created: 2016-10-19 03:55:40.0
Updated: 2016-10-19 06:21:52.0
Pushed: 2017-01-02 21:13:04.0
Homepage: null
Size: 5
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
A test helper to make sure fixtures are torn down and error messages are retained
tion withFixtures([Fixture, Fixture, ...], Fn -> Promise<Any>) -> Promise<Any>
t withFixtures = require('with-fixtures');
Fixtures([
xture1,
xture2
) => {
Do test here and return a promise
hen(() => console.log("Test passed"), err => cosole.warn("test failed"));
A Fixture is an object with a done()
method. Any errors thrown while tearing
down the fixture in the done method will be captured, and the first will be
reported as a rejection of the promise chain, if the test itself did not
reject.
All of the fixtures will have their done()
method called.
For compatibility with sinon
, if there is no done()
method on a fixture but there is a restore()
method, that will be called
instead.
The promise will resolve to one of the following: