Skip to content

Commit 5001f35

Browse files
committed
chore: Updated dependencies.
1 parent 1e59e48 commit 5001f35

File tree

5 files changed

+18
-16
lines changed

5 files changed

+18
-16
lines changed

package.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,24 @@
3737
"postpublish": "git push origin && git push origin -f --tags"
3838
},
3939
"dependencies": {
40-
"acquerello": "^1.1.2",
40+
"acquerello": "^2.0.0",
4141
"hdr-histogram-js": "^3.0.0",
4242
"table": "^6.8.1"
4343
},
4444
"devDependencies": {
45-
"@cowtech/eslint-config": "^8.10.0",
46-
"@swc/cli": "^0.1.62",
47-
"@swc/core": "^1.3.94",
48-
"@types/node": "^20.8.7",
49-
"@types/tap": "^15.0.10",
45+
"@cowtech/eslint-config": "^9.0.0",
46+
"@swc/cli": "^0.1.63",
47+
"@swc/core": "^1.3.101",
48+
"@types/node": "^20.10.5",
49+
"@types/tap": "^15.0.11",
5050
"c8": "^8.0.1",
5151
"chokidar": "^3.5.3",
5252
"concurrently": "^8.2.2",
53-
"prettier": "^3.0.3",
53+
"prettier": "^3.1.1",
5454
"proxyquire": "^2.1.3",
55-
"tap": "^18.5.2",
56-
"ts-node": "^10.9.1",
57-
"typescript": "^5.2.2"
55+
"tap": "^18.6.1",
56+
"ts-node": "^10.9.2",
57+
"typescript": "^5.3.3"
5858
},
5959
"engines": {
6060
"node": ">= 18.18.0"

src/index.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { isMainThread, Worker, workerData } from 'node:worker_threads'
22
import {
33
defaultOptions,
4+
type Result,
45
runnerPath,
56
type Callback,
67
type Context,
@@ -88,7 +89,7 @@ function run(context: Context): void {
8889
context.current++
8990

9091
if (context.onTestEnd) {
91-
context.onTestEnd(name, result, worker)
92+
context.onTestEnd(name, result as Result, worker)
9293
}
9394

9495
scheduleNextTest(context)

src/runner.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { isMainThread, parentPort, workerData } from 'node:worker_threads'
2+
import { type WorkerContext } from './models.js'
23
import { runWorker } from './worker.js'
34

45
if (isMainThread) {
@@ -34,11 +35,11 @@ chain
3435
.then(() => {
3536
// Run the worker
3637
runWorker(
37-
workerData,
38+
workerData as WorkerContext,
3839
value => {
3940
parentPort!.postMessage({ type: 'cronometro.result', payload: value })
4041
},
41-
process.exit
42+
(code: number) => process.exit(code)
4243
)
4344
})
4445
.catch(error => {

src/worker.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ function runTestIteration(context: TestContext): void {
103103
} catch (error) {
104104
// If a error was thrown, only handle if the original function length is 0, which means it's a sync error, otherwise propagate
105105
if (context.test.length === 0) {
106-
context.handler(error)
106+
context.handler(error as Error)
107107
return
108108
}
109109

test/genericErrorHandling.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
import { isMainThread } from 'node:worker_threads'
44
import t from 'tap'
5-
import { cronometro } from '../src/index.js'
5+
import { cronometro, type Tests } from '../src/index.js'
66

77
if (!isMainThread) {
8-
cronometro(undefined as any, () => false)
8+
cronometro(undefined as unknown as Tests, () => false)
99
} else {
1010
t.test('Generic error handling', async t => {
1111
const results = await cronometro(

0 commit comments

Comments
 (0)