Closed lundibundi closed 5 years ago
This will allow to also use this function when additional callback needs to be called. (e.g. from test.beforeEach or test.afterEach).
e.g.
test('test', test => { test.beforeEach((t, cb) => { metasync.sequential([ (ctx, cb) => method1('a', t.cbFail(data => ctx.a = data, cb)), (ctx, cb) => method2('b', t.cbFail(data => ctx.b = data, cb)), ], cb); }); test.beforeEach((t, cb) => { method('a', t.cbFail(data => console.log(data), () => cb())); }); });
That's true, this solution is quite crude but at least it allows to properly use the cbFail function in cases when additional callback needs to be called. I'll be happy to change this to something better.
cbFail
Landed in https://github.com/metarhia/metatests/commit/d5fbe7827bd388d9d78c2bb7f98cd02b83331562.
This will allow to also use this function when additional callback needs to be called. (e.g. from test.beforeEach or test.afterEach).
e.g.