@cedarjs/testing 7.0.1-next.314 → 7.0.1-next.466
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CedarApiVitestEnv.d.ts","sourceRoot":"","sources":["../../../src/api/vitest/CedarApiVitestEnv.ts"],"names":[],"mappings":"AAEA,OAAO,2BAA2B,CAAA;AAElC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"CedarApiVitestEnv.d.ts","sourceRoot":"","sources":["../../../src/api/vitest/CedarApiVitestEnv.ts"],"names":[],"mappings":"AAEA,OAAO,2BAA2B,CAAA;AAElC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAoDtD,QAAA,MAAM,yBAAyB,EAAE,WAoHhC,CAAA;AAED,eAAe,yBAAyB,CAAA"}
|
|
@@ -8,6 +8,22 @@ import {
|
|
|
8
8
|
checkTestDatabaseUrlMatchesProvider,
|
|
9
9
|
redactDatabaseUrl
|
|
10
10
|
} from "../checkTestDatabase.js";
|
|
11
|
+
const MAX_ERROR_OUTPUT_LENGTH = 4e3;
|
|
12
|
+
function joinOutput(stdout, stderr) {
|
|
13
|
+
return [stdout, stderr].map((stream) => stream?.trim()).filter((stream) => Boolean(stream)).join("\n");
|
|
14
|
+
}
|
|
15
|
+
function formatDbResetError(command, exitCode, output) {
|
|
16
|
+
const exitInfo = typeof exitCode === "number" ? ` (exit code ${exitCode})` : "";
|
|
17
|
+
const lines = [
|
|
18
|
+
`Failed to reset the test database${exitInfo}.`,
|
|
19
|
+
`Command: ${command}`
|
|
20
|
+
];
|
|
21
|
+
if (output) {
|
|
22
|
+
const trimmedOutput = output.length > MAX_ERROR_OUTPUT_LENGTH ? "...\n" + output.slice(-MAX_ERROR_OUTPUT_LENGTH) : output;
|
|
23
|
+
lines.push("", "Output:", trimmedOutput);
|
|
24
|
+
}
|
|
25
|
+
return lines.join("\n");
|
|
26
|
+
}
|
|
11
27
|
const CedarApiVitestEnvironment = {
|
|
12
28
|
name: "cedar-api",
|
|
13
29
|
viteEnvironment: "ssr",
|
|
@@ -43,11 +59,30 @@ const CedarApiVitestEnvironment = {
|
|
|
43
59
|
if (testConfig.autoConsentToDbReset && !("PRISMA_USER_CONSENT_FOR_DANGEROUS_AI_ACTION" in env)) {
|
|
44
60
|
env.PRISMA_USER_CONSENT_FOR_DANGEROUS_AI_ACTION = "Cedar auto-consent: cedar.toml's [test] autoConsentToDbReset is true, and the reset target passed Cedar's test-database identity guard.";
|
|
45
61
|
}
|
|
46
|
-
execa.sync(pmExec, ["cedar", ...command], {
|
|
62
|
+
const result = execa.sync(pmExec, ["cedar", ...command], {
|
|
47
63
|
cwd: cedarPaths.api.base,
|
|
48
|
-
|
|
49
|
-
|
|
64
|
+
env,
|
|
65
|
+
reject: false
|
|
50
66
|
});
|
|
67
|
+
if (result.failed) {
|
|
68
|
+
const output = joinOutput(result.stdout, result.stderr);
|
|
69
|
+
if (output) {
|
|
70
|
+
console.error(output);
|
|
71
|
+
}
|
|
72
|
+
throw new Error(
|
|
73
|
+
formatDbResetError(
|
|
74
|
+
result.command,
|
|
75
|
+
result.exitCode,
|
|
76
|
+
output || (result instanceof Error ? result.message : "")
|
|
77
|
+
)
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
if (result.stdout) {
|
|
81
|
+
console.log(result.stdout);
|
|
82
|
+
}
|
|
83
|
+
if (result.stderr) {
|
|
84
|
+
console.error(result.stderr);
|
|
85
|
+
}
|
|
51
86
|
return {
|
|
52
87
|
teardown() {
|
|
53
88
|
}
|
package/dist/web/mockAuth.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockAuth.d.ts","sourceRoot":"","sources":["../../src/web/mockAuth.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,cAAc,eAAe,CAAA;AAI7B,UAAU,KAAK;IACb,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAYD,wBAAgB,OAAO;;;;;;;;;;qBAWF,MAAM,GAAG,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"mockAuth.d.ts","sourceRoot":"","sources":["../../src/web/mockAuth.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,cAAc,eAAe,CAAA;AAI7B,UAAU,KAAK;IACb,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAYD,wBAAgB,OAAO;;;;;;;;;;qBAWF,MAAM,GAAG,MAAM,EAAE;;;;;;;;;EAoBrC;AAED,eAAO,MAAM,oBAAoB;;;CAEhC,CAAA"}
|
package/dist/web/mockAuth.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/testing",
|
|
3
|
-
"version": "7.0.1-next.
|
|
3
|
+
"version": "7.0.1-next.466",
|
|
4
4
|
"description": "Tools, wrappers and configuration for testing a Cedar project.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -54,14 +54,14 @@
|
|
|
54
54
|
"test:watch": "vitest watch"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@cedarjs/context": "7.0.1-next.
|
|
58
|
-
"@cedarjs/graphql-server": "7.0.1-next.
|
|
59
|
-
"@cedarjs/project-config": "7.0.1-next.
|
|
57
|
+
"@cedarjs/context": "7.0.1-next.466",
|
|
58
|
+
"@cedarjs/graphql-server": "7.0.1-next.466",
|
|
59
|
+
"@cedarjs/project-config": "7.0.1-next.466",
|
|
60
60
|
"@testing-library/dom": "10.4.2",
|
|
61
61
|
"@testing-library/jest-dom": "6.9.1",
|
|
62
62
|
"@testing-library/react": "16.3.3",
|
|
63
63
|
"@testing-library/user-event": "14.6.7",
|
|
64
|
-
"@types/aws-lambda": "8.10.
|
|
64
|
+
"@types/aws-lambda": "8.10.164",
|
|
65
65
|
"@types/jest": "29.5.14",
|
|
66
66
|
"@types/node": "24.10.4",
|
|
67
67
|
"ansis": "4.4.0",
|
|
@@ -73,19 +73,19 @@
|
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@arethetypeswrong/cli": "0.18.5",
|
|
76
|
-
"@cedarjs/auth": "7.0.1-next.
|
|
77
|
-
"@cedarjs/framework-tools": "7.0.1-next.
|
|
78
|
-
"@cedarjs/router": "7.0.1-next.
|
|
79
|
-
"@cedarjs/web": "7.0.1-next.
|
|
80
|
-
"concurrently": "9.2.
|
|
81
|
-
"publint": "0.3.
|
|
76
|
+
"@cedarjs/auth": "7.0.1-next.466",
|
|
77
|
+
"@cedarjs/framework-tools": "7.0.1-next.466",
|
|
78
|
+
"@cedarjs/router": "7.0.1-next.466",
|
|
79
|
+
"@cedarjs/web": "7.0.1-next.466",
|
|
80
|
+
"concurrently": "9.2.5",
|
|
81
|
+
"publint": "0.3.25",
|
|
82
82
|
"typescript": "5.9.3",
|
|
83
83
|
"vitest": "4.1.11"
|
|
84
84
|
},
|
|
85
85
|
"peerDependencies": {
|
|
86
|
-
"@cedarjs/auth": "7.0.1-next.
|
|
87
|
-
"@cedarjs/router": "7.0.1-next.
|
|
88
|
-
"@cedarjs/web": "7.0.1-next.
|
|
86
|
+
"@cedarjs/auth": "7.0.1-next.466",
|
|
87
|
+
"@cedarjs/router": "7.0.1-next.466",
|
|
88
|
+
"@cedarjs/web": "7.0.1-next.466",
|
|
89
89
|
"vitest": "4.1.11"
|
|
90
90
|
},
|
|
91
91
|
"peerDependenciesMeta": {
|