Comparing version 0.0.65 to 0.0.66
{ | ||
"name": "@lbu/cli", | ||
"version": "0.0.65", | ||
"version": "0.0.66", | ||
"description": "CLI containing utilities and simple script runner", | ||
@@ -30,4 +30,4 @@ "main": "./index.js", | ||
"dependencies": { | ||
"@lbu/insight": "0.0.65", | ||
"@lbu/stdlib": "0.0.65", | ||
"@lbu/insight": "0.0.66", | ||
"@lbu/stdlib": "0.0.66", | ||
"c8": "7.3.0", | ||
@@ -59,3 +59,3 @@ "chokidar": "3.4.2", | ||
}, | ||
"gitHead": "843efcbe36702f8a7e17992d81fa24ff621fda18" | ||
"gitHead": "828e6b5c7605a1f299cf549a34776ad2aa61db58" | ||
} |
import { deepStrictEqual } from "assert"; | ||
import { isNil } from "@lbu/stdlib"; | ||
import { state, testLogger } from "./state.js"; | ||
import { state, testLogger, timeout } from "./state.js"; | ||
@@ -20,3 +20,2 @@ /** | ||
// Does a race so tests don't run for too long | ||
// TODO: Make race timeout configurable | ||
await Promise.race([ | ||
@@ -26,4 +25,9 @@ result, | ||
setTimeout( | ||
() => reject(new Error(`Exceeded test timeout of 15 seconds.`)), | ||
15000, | ||
() => | ||
reject( | ||
new Error( | ||
`Exceeded test timeout of ${timeout / 1000} seconds.`, | ||
), | ||
), | ||
timeout, | ||
); | ||
@@ -30,0 +34,0 @@ }), |
@@ -12,2 +12,7 @@ /** | ||
/** | ||
* @type {number} | ||
*/ | ||
export let timeout = 2500; | ||
/** | ||
* @type {TestState} | ||
@@ -36,1 +41,9 @@ */ | ||
} | ||
/** | ||
* Set test timeout value in milliseconds | ||
* @param value | ||
*/ | ||
export function setTestTimeout(value) { | ||
timeout = value; | ||
} |
@@ -6,2 +6,3 @@ /** | ||
import { mainFn } from "@lbu/stdlib"; | ||
import { loadTestConfig } from "./config.js"; | ||
import { printTestResults } from "./printer.js"; | ||
@@ -31,7 +32,14 @@ import { runTestsRecursively } from "./runner.js"; | ||
}); | ||
const { setup, teardown } = await loadTestConfig(); | ||
await setup(); | ||
await runTestsRecursively(state); | ||
const exitCode = printTestResults(); | ||
await teardown(); | ||
process.exit(exitCode); | ||
}); | ||
} |
1978
61025
12
+ Added@lbu/insight@0.0.66(transitive)
+ Added@lbu/stdlib@0.0.66(transitive)
- Removed@lbu/insight@0.0.65(transitive)
- Removed@lbu/stdlib@0.0.65(transitive)
Updated@lbu/insight@0.0.66
Updated@lbu/stdlib@0.0.66