Skip to content

Commit 129de8e

Browse files
committed
feat(cli): optional t argument for newTestEvent
1 parent b40a15f commit 129de8e

File tree

7 files changed

+19
-34
lines changed

7 files changed

+19
-34
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"node": ">=18"
1414
},
1515
"devDependencies": {
16-
"@lightbase/eslint-config": "1.2.0",
16+
"@lightbase/eslint-config": "2.0.0",
1717
"@types/node": "22.7.8",
1818
"@types/react": "18.3.11",
1919
"@tanstack/react-query": "5.59.15",

packages/cli/src/testing/events.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
1-
import { newEvent } from "@compas/stdlib";
1+
import { isNil, newEvent, newLogger } from "@compas/stdlib";
22

33
/**
44
* Create a new test event
55
*
66
* @since 0.1.0
77
*
8-
* @param {import("../../types/advanced-types.d.ts").TestRunner} t
8+
* @param {import("../../types/advanced-types.d.ts").TestRunner} [t]
99
* @returns {import("@compas/stdlib").InsightEvent}
1010
*/
1111
export function newTestEvent(t) {
12-
return newEvent(t.log, t.signal);
12+
if (!isNil(t) && typeof t === "object" && typeof t.log?.info === "function") {
13+
return newEvent(t.log, t.signal);
14+
}
15+
16+
return newEvent(
17+
newLogger({
18+
ctx: {
19+
type: "new-test-event",
20+
},
21+
}),
22+
);
1323
}

packages/code-gen/package.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,7 @@
1212
"./package.json": "./package.json"
1313
},
1414
"type": "module",
15-
"keywords": [
16-
"compas",
17-
"generate",
18-
"router",
19-
"validation",
20-
"code-gen"
21-
],
15+
"keywords": ["compas", "generate", "router", "validation", "code-gen"],
2216
"license": "MIT",
2317
"dependencies": {
2418
"@compas/stdlib": "0.15.1"

packages/create-compas/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@
99
"bin": {
1010
"create-compas": "src/create-compas.js"
1111
},
12-
"keywords": [
13-
"compas",
14-
"create"
15-
],
12+
"keywords": ["compas", "create"],
1613
"license": "MIT",
1714
"dependencies": {
1815
"@compas/stdlib": "0.15.1",

packages/server/package.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,7 @@
1212
"./package.json": "./package.json"
1313
},
1414
"type": "module",
15-
"keywords": [
16-
"compas",
17-
"koa",
18-
"api",
19-
"http",
20-
"backend"
21-
],
15+
"keywords": ["compas", "koa", "api", "http", "backend"],
2216
"license": "MIT",
2317
"dependencies": {
2418
"@compas/stdlib": "0.15.1",

packages/stdlib/package.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,7 @@
1212
"./package.json": "./package.json"
1313
},
1414
"type": "module",
15-
"keywords": [
16-
"compas",
17-
"stdlib",
18-
"standard",
19-
"logger"
20-
],
15+
"keywords": ["compas", "stdlib", "standard", "logger"],
2116
"license": "MIT",
2217
"dependencies": {
2318
"@types/node": "22.7.8",

packages/store/package.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,7 @@
1212
"./package.json": "./package.json"
1313
},
1414
"type": "module",
15-
"keywords": [
16-
"compas",
17-
"s3",
18-
"postgres",
19-
"persistence"
20-
],
15+
"keywords": ["compas", "s3", "postgres", "persistence"],
2116
"license": "MIT",
2217
"dependencies": {
2318
"@aws-sdk/client-s3": "3.675.0",

0 commit comments

Comments
 (0)