Open leimonio opened 7 years ago
I would like to extract assertion functionality to separate helper functions. I'm already using mocha-generators and I'd like to implement the following case:
Assume we have a shared function like below:
function sharedFn(params) { return function* (nightmare) { yield nightmare.wait(1000) (...some functionality here) } }
The snippet below works:
... it('should combine use with a generator', function* () { yield nightmare.wait(1000) yield* sharedFn(params)(nightmare) }) ...
But how can I implement it with .use, like:
.use
... it('should combine use with a generator', function* () { yield nightmare .wait(1000) .use(sharedFn(params)) }) ...
I would like to extract assertion functionality to separate helper functions. I'm already using mocha-generators and I'd like to implement the following case:
Assume we have a shared function like below:
The snippet below works:
But how can I implement it with
.use
, like: