Commit 2ee6ec8a authored by Iuri Matias's avatar Iuri Matias

support beforeEach; if condition for adding special functions

parent e525eaad
......@@ -8,11 +8,14 @@ function runTest(testName, testObject, testCallback, resultsCallback) {
let availableFunctions = testObject._jsonInterface.filter((x) => x.type === 'function').map((x) => x.name);
let testFunctions = testObject._jsonInterface.filter((x) => specialFunctions.indexOf(x.name) < 0 && x.type === 'function');
if (availableFunctions.indexOf("beforeAll")) {
if (availableFunctions.indexOf("beforeAll") >= 0) {
runList.push({name: 'beforeAll', type: 'internal', constant: false});
}
for (let func of testFunctions) {
if (availableFunctions.indexOf("beforeEach") >= 0) {
runList.push({name: 'beforeEach', type: 'internal', constant: false});
}
runList.push({name: func.name, type: 'test', constant: func.constant});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment