MCPcopy Index your code
hub / github.com/codecombat/codecombat / wrapJasmine

Function wrapJasmine

test/app/utils.js:9–22  ·  view source on GitHub ↗
(gen)

Source from the content-addressed store, hash-verified

7const co = require('co');
8
9const wrapJasmine = function(gen) {
10 const arity = gen.length;
11 const fn = co.wrap(gen);
12 return function(done) {
13 // Run the wrapped, Promise returning test function
14 return fn.apply(this, arity === 0 ? [] : [done])
15
16 // Finish the test if it doesn't include a 'done' argument
17 .then(function() { if (arity === 0) { return done(); } })
18
19 // Fail on runtime error
20 .catch(err => done.fail(err));
21 };
22};
23
24module.exports = {
25 wrapJasmine

Calls 2

applyMethod · 0.80
failMethod · 0.80

Tested by

no test coverage detected