Skip to content

Commit

Permalink
chore: Updated dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
ShogunPanda committed Dec 20, 2023
1 parent 1e59e48 commit 5001f35
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 16 deletions.
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,24 @@
"postpublish": "git push origin && git push origin -f --tags"
},
"dependencies": {
"acquerello": "^1.1.2",
"acquerello": "^2.0.0",
"hdr-histogram-js": "^3.0.0",
"table": "^6.8.1"
},
"devDependencies": {
"@cowtech/eslint-config": "^8.10.0",
"@swc/cli": "^0.1.62",
"@swc/core": "^1.3.94",
"@types/node": "^20.8.7",
"@types/tap": "^15.0.10",
"@cowtech/eslint-config": "^9.0.0",
"@swc/cli": "^0.1.63",
"@swc/core": "^1.3.101",
"@types/node": "^20.10.5",
"@types/tap": "^15.0.11",
"c8": "^8.0.1",
"chokidar": "^3.5.3",
"concurrently": "^8.2.2",
"prettier": "^3.0.3",
"prettier": "^3.1.1",
"proxyquire": "^2.1.3",
"tap": "^18.5.2",
"ts-node": "^10.9.1",
"typescript": "^5.2.2"
"tap": "^18.6.1",
"ts-node": "^10.9.2",
"typescript": "^5.3.3"
},
"engines": {
"node": ">= 18.18.0"
Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { isMainThread, Worker, workerData } from 'node:worker_threads'
import {
defaultOptions,
type Result,
runnerPath,
type Callback,
type Context,
Expand Down Expand Up @@ -88,7 +89,7 @@ function run(context: Context): void {
context.current++

if (context.onTestEnd) {
context.onTestEnd(name, result, worker)
context.onTestEnd(name, result as Result, worker)
}

scheduleNextTest(context)
Expand Down
5 changes: 3 additions & 2 deletions src/runner.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { isMainThread, parentPort, workerData } from 'node:worker_threads'
import { type WorkerContext } from './models.js'
import { runWorker } from './worker.js'

if (isMainThread) {
Expand Down Expand Up @@ -34,11 +35,11 @@ chain
.then(() => {
// Run the worker
runWorker(
workerData,
workerData as WorkerContext,
value => {
parentPort!.postMessage({ type: 'cronometro.result', payload: value })
},
process.exit
(code: number) => process.exit(code)
)
})
.catch(error => {
Expand Down
2 changes: 1 addition & 1 deletion src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function runTestIteration(context: TestContext): void {
} catch (error) {
// If a error was thrown, only handle if the original function length is 0, which means it's a sync error, otherwise propagate
if (context.test.length === 0) {
context.handler(error)
context.handler(error as Error)
return
}

Expand Down
4 changes: 2 additions & 2 deletions test/genericErrorHandling.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import { isMainThread } from 'node:worker_threads'
import t from 'tap'
import { cronometro } from '../src/index.js'
import { cronometro, type Tests } from '../src/index.js'

if (!isMainThread) {
cronometro(undefined as any, () => false)
cronometro(undefined as unknown as Tests, () => false)
} else {
t.test('Generic error handling', async t => {
const results = await cronometro(
Expand Down

0 comments on commit 5001f35

Please sign in to comment.