Comparing version 3.0.1-canary.a96f9ab to 3.0.1-canary.d486f01
@@ -15,3 +15,3 @@ "use strict"; | ||
}; | ||
exports.VERSION = '3.0.1-canary.a96f9ab'; | ||
exports.VERSION = '3.0.1-canary.d486f01'; | ||
exports.deepOptions = []; | ||
@@ -18,0 +18,0 @@ exports.GLOBAL = { |
@@ -23,3 +23,2 @@ "use strict"; | ||
let resolveDone; | ||
let rejectDone; | ||
const { configs } = poku_js_1.GLOBAL; | ||
@@ -36,5 +35,5 @@ const testDir = (0, node_path_1.join)(cwd, dir); | ||
})(); | ||
const done = new Promise((resolve, reject) => { | ||
const isSequential = concurrency === 1; | ||
const done = new Promise((resolve) => { | ||
resolveDone = resolve; | ||
rejectDone = reject; | ||
}); | ||
@@ -50,29 +49,25 @@ const runNext = async () => { | ||
activeTests++; | ||
try { | ||
const testPassed = await (0, run_test_file_js_1.runTestFile)(filePath); | ||
if (testPassed) | ||
++poku_js_1.results.passed; | ||
else { | ||
++poku_js_1.results.failed; | ||
allPassed = false; | ||
if (configs.failFast) { | ||
if (showLogs) { | ||
(0, write_js_1.hr)(); | ||
console.error(failFastError); | ||
(0, write_js_1.log)(`\n ${(0, format_js_1.format)('File:').bold()} ${(0, format_js_1.format)(`./${(0, node_path_1.relative)(cwd, filePath)}`).fail()}`); | ||
(0, write_js_1.hr)(); | ||
} | ||
node_process_1.default.exit(1); | ||
const testPassed = await (0, run_test_file_js_1.runTestFile)(filePath); | ||
if (testPassed) | ||
++poku_js_1.results.passed; | ||
else { | ||
++poku_js_1.results.failed; | ||
allPassed = false; | ||
if (configs.failFast) { | ||
if (showLogs) { | ||
(0, write_js_1.hr)(); | ||
console.error(failFastError); | ||
(0, write_js_1.log)(`\n ${(0, format_js_1.format)('File:').bold()} ${(0, format_js_1.format)(`./${(0, node_path_1.relative)(cwd, filePath)}`).fail()}`); | ||
(0, write_js_1.hr)(); | ||
} | ||
node_process_1.default.exit(1); | ||
} | ||
} | ||
finally { | ||
activeTests--; | ||
} | ||
runNext().catch(rejectDone); | ||
activeTests--; | ||
isSequential ? await runNext() : runNext(); | ||
}; | ||
for (let i = 0; i < concurrency; i++) | ||
runNext(); | ||
isSequential ? await runNext() : runNext(); | ||
return await done; | ||
}; | ||
exports.runTests = runTests; |
{ | ||
"name": "poku", | ||
"version": "3.0.1-canary.a96f9ab", | ||
"version": "3.0.1-canary.d486f01", | ||
"description": "🐷 Poku makes testing easy for Node.js, Bun, Deno, and you at the same time.", | ||
@@ -55,6 +55,6 @@ "main": "./lib/modules/index.js", | ||
"@ianvs/prettier-plugin-sort-imports": "^4.4.1", | ||
"@types/node": "^22.12.0", | ||
"@types/node": "^22.13.1", | ||
"c8": "^10.1.3", | ||
"jsonc.min": "^1.1.0", | ||
"monocart-coverage-reports": "^2.12.0", | ||
"monocart-coverage-reports": "^2.12.1", | ||
"packages-update": "^2.0.0", | ||
@@ -61,0 +61,0 @@ "prettier": "^3.4.2", |
174007
3927