When testing a server, there can be a lot of redundant code for setting up common fixtures in every test of every route. To avoid this problem, we are exploring using a scenario
function which is similar to describe
but runs default actions (e.g. setting up database fixtures, starting fake servers) and is configurable via options.
Example usage:
var scenario = require('./scenario');
scenario('A request to GET /', function () {
it('has no errors', function () {
});
});
scenario.skip('A request to GET /pending', function () {
it('has no errors', function () {
});
});
scenario('A request to GET / with fixtures', {
dbFixtures: ['user-default']
}, function () {
it('has no errors', function () {
});
});
Typo on line 32 & 34,
scenarionFn
->scenarioFn