thunk-test
Advanced tools
Comparing version 0.7.1 to 0.7.2
{ | ||
"name": "thunk-test", | ||
"version": "0.7.1", | ||
"version": "0.7.2", | ||
"description": "Modular testing for JavaScript", | ||
@@ -5,0 +5,0 @@ "author": "Richard Tong", |
@@ -14,3 +14,3 @@ const Test = require('./thunk-test') | ||
}) | ||
.after(function () { | ||
.after(async function () { | ||
assert.strictEqual(this.hello, 'world') | ||
@@ -25,3 +25,3 @@ console.log('I should be at the end') | ||
}) | ||
.before(function () { | ||
.before(async function () { | ||
assert.strictEqual(this.hello, 'world') | ||
@@ -28,0 +28,0 @@ console.log('I should be second at the beginning') |
@@ -523,3 +523,2 @@ const noop = function () {} | ||
/** | ||
@@ -546,2 +545,12 @@ * @name Test | ||
const arrayFlatMap = function (array, flatMapper) { | ||
const arrayLength = array.length, | ||
result = [] | ||
let arrayIndex = -1 | ||
while (++arrayIndex < arrayLength) { | ||
result.push(...flatMapper(array[arrayIndex])) | ||
} | ||
return result | ||
} | ||
const Test = function (...funcs) { | ||
@@ -568,3 +577,4 @@ if (typeof this == null || this.constructor != Test) { | ||
return cursor.then(funcConcat( | ||
thunkify1(thunkTestExec, operations.flatMap( | ||
thunkify1(thunkTestExec, arrayFlatMap( | ||
operations, | ||
operation => [...microPreprocessing, operation, ...microPostprocessing])), | ||
@@ -575,3 +585,4 @@ thunkify1(thunkTestExec, postprocessing), | ||
cursor = thunkTestExec(operations.flatMap( | ||
cursor = thunkTestExec(arrayFlatMap( | ||
operations, | ||
operation => [...microPreprocessing, operation, ...microPostprocessing])) | ||
@@ -578,0 +589,0 @@ if (isPromise(cursor)) { |
24063
704