@cedarjs/testing 6.0.0-canary.2671 → 6.0.0-canary.2673
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.
- package/dist/api/vitest/CedarApiVitestEnv.js +1 -1
- package/dist/api/vitest/vite-plugin-cedar-vitest-api-config.js +7 -7
- package/dist/api/vitest/vitest-api.setup.js +4 -4
- package/dist/cjs/api/vitest/CedarApiVitestEnv.js +1 -1
- package/dist/cjs/api/vitest/vite-plugin-cedar-vitest-api-config.js +7 -7
- package/dist/cjs/api/vitest/vitest-api.setup.js +4 -4
- package/package.json +11 -11
|
@@ -5,7 +5,7 @@ import { getPaths } from "@cedarjs/project-config";
|
|
|
5
5
|
import { getPackageManager } from "@cedarjs/project-config/packageManager";
|
|
6
6
|
const CedarApiVitestEnvironment = {
|
|
7
7
|
name: "cedar-api",
|
|
8
|
-
|
|
8
|
+
viteEnvironment: "ssr",
|
|
9
9
|
async setup() {
|
|
10
10
|
if (process.env.SKIP_DB_PUSH === "1") {
|
|
11
11
|
return {
|
|
@@ -16,13 +16,13 @@ function cedarVitestApiConfigPlugin() {
|
|
|
16
16
|
},
|
|
17
17
|
test: {
|
|
18
18
|
environment: path.join(import.meta.dirname, "CedarApiVitestEnv.js"),
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
//
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
|
|
19
|
+
// All api test files share a single test database, so they can't
|
|
20
|
+
// run in parallel. In Vitest 3 project-level fileParallelism didn't
|
|
21
|
+
// work (https://github.com/vitest-dev/vitest/discussions/7416) and
|
|
22
|
+
// we used the now-removed `poolOptions: { forks: { singleFork:
|
|
23
|
+
// true } }` as a workaround. Vitest 4 removed `poolOptions` and
|
|
24
|
+
// supports `fileParallelism` in project configs.
|
|
25
|
+
fileParallelism: false,
|
|
26
26
|
setupFiles: [path.join(import.meta.dirname, "vitest-api.setup.js")]
|
|
27
27
|
}
|
|
28
28
|
};
|
|
@@ -60,8 +60,8 @@ function buildScenario(itFunc) {
|
|
|
60
60
|
} else {
|
|
61
61
|
throw new Error("scenario() requires 2 or 3 arguments");
|
|
62
62
|
}
|
|
63
|
-
return itFunc(testName, async (
|
|
64
|
-
const testPath =
|
|
63
|
+
return itFunc(testName, async ({ task }) => {
|
|
64
|
+
const testPath = task.file.filepath;
|
|
65
65
|
const { scenario } = await loadScenarios(testPath, scenarioName);
|
|
66
66
|
const scenarioData = await seedScenario(scenario);
|
|
67
67
|
try {
|
|
@@ -89,8 +89,8 @@ function buildDescribeScenario(describeFunc) {
|
|
|
89
89
|
}
|
|
90
90
|
return describeFunc(describeBlockName, () => {
|
|
91
91
|
let scenarioData;
|
|
92
|
-
beforeAll(async (
|
|
93
|
-
const testPath =
|
|
92
|
+
beforeAll(async ({}, suite) => {
|
|
93
|
+
const testPath = suite.file.filepath;
|
|
94
94
|
const { scenario } = await loadScenarios(testPath, scenarioName);
|
|
95
95
|
scenarioData = await seedScenario(scenario);
|
|
96
96
|
});
|
|
@@ -38,7 +38,7 @@ var import_project_config = require("@cedarjs/project-config");
|
|
|
38
38
|
var import_packageManager = require("@cedarjs/project-config/packageManager");
|
|
39
39
|
const CedarApiVitestEnvironment = {
|
|
40
40
|
name: "cedar-api",
|
|
41
|
-
|
|
41
|
+
viteEnvironment: "ssr",
|
|
42
42
|
async setup() {
|
|
43
43
|
if (process.env.SKIP_DB_PUSH === "1") {
|
|
44
44
|
return {
|
|
@@ -50,13 +50,13 @@ function cedarVitestApiConfigPlugin() {
|
|
|
50
50
|
},
|
|
51
51
|
test: {
|
|
52
52
|
environment: import_node_path.default.join(import_meta.dirname, "CedarApiVitestEnv.js"),
|
|
53
|
-
//
|
|
54
|
-
//
|
|
55
|
-
//
|
|
56
|
-
//
|
|
57
|
-
//
|
|
58
|
-
//
|
|
59
|
-
|
|
53
|
+
// All api test files share a single test database, so they can't
|
|
54
|
+
// run in parallel. In Vitest 3 project-level fileParallelism didn't
|
|
55
|
+
// work (https://github.com/vitest-dev/vitest/discussions/7416) and
|
|
56
|
+
// we used the now-removed `poolOptions: { forks: { singleFork:
|
|
57
|
+
// true } }` as a workaround. Vitest 4 removed `poolOptions` and
|
|
58
|
+
// supports `fileParallelism` in project configs.
|
|
59
|
+
fileParallelism: false,
|
|
60
60
|
setupFiles: [import_node_path.default.join(import_meta.dirname, "vitest-api.setup.js")]
|
|
61
61
|
}
|
|
62
62
|
};
|
|
@@ -83,8 +83,8 @@ function buildScenario(itFunc) {
|
|
|
83
83
|
} else {
|
|
84
84
|
throw new Error("scenario() requires 2 or 3 arguments");
|
|
85
85
|
}
|
|
86
|
-
return itFunc(testName, async (
|
|
87
|
-
const testPath =
|
|
86
|
+
return itFunc(testName, async ({ task }) => {
|
|
87
|
+
const testPath = task.file.filepath;
|
|
88
88
|
const { scenario } = await loadScenarios(testPath, scenarioName);
|
|
89
89
|
const scenarioData = await seedScenario(scenario);
|
|
90
90
|
try {
|
|
@@ -112,8 +112,8 @@ function buildDescribeScenario(describeFunc) {
|
|
|
112
112
|
}
|
|
113
113
|
return describeFunc(describeBlockName, () => {
|
|
114
114
|
let scenarioData;
|
|
115
|
-
(0, import_vitest.beforeAll)(async (
|
|
116
|
-
const testPath =
|
|
115
|
+
(0, import_vitest.beforeAll)(async ({}, suite) => {
|
|
116
|
+
const testPath = suite.file.filepath;
|
|
117
117
|
const { scenario } = await loadScenarios(testPath, scenarioName);
|
|
118
118
|
scenarioData = await seedScenario(scenario);
|
|
119
119
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/testing",
|
|
3
|
-
"version": "6.0.0-canary.
|
|
3
|
+
"version": "6.0.0-canary.2673",
|
|
4
4
|
"description": "Tools, wrappers and configuration for testing a Cedar project.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -116,10 +116,10 @@
|
|
|
116
116
|
"test:watch": "vitest watch"
|
|
117
117
|
},
|
|
118
118
|
"dependencies": {
|
|
119
|
-
"@cedarjs/babel-config": "6.0.0-canary.
|
|
120
|
-
"@cedarjs/context": "6.0.0-canary.
|
|
121
|
-
"@cedarjs/graphql-server": "6.0.0-canary.
|
|
122
|
-
"@cedarjs/project-config": "6.0.0-canary.
|
|
119
|
+
"@cedarjs/babel-config": "6.0.0-canary.2673",
|
|
120
|
+
"@cedarjs/context": "6.0.0-canary.2673",
|
|
121
|
+
"@cedarjs/graphql-server": "6.0.0-canary.2673",
|
|
122
|
+
"@cedarjs/project-config": "6.0.0-canary.2673",
|
|
123
123
|
"@testing-library/dom": "10.4.1",
|
|
124
124
|
"@testing-library/jest-dom": "6.9.1",
|
|
125
125
|
"@testing-library/react": "16.3.2",
|
|
@@ -141,21 +141,21 @@
|
|
|
141
141
|
},
|
|
142
142
|
"devDependencies": {
|
|
143
143
|
"@arethetypeswrong/cli": "0.18.5",
|
|
144
|
-
"@cedarjs/auth": "6.0.0-canary.
|
|
145
|
-
"@cedarjs/framework-tools": "6.0.0-canary.
|
|
146
|
-
"@cedarjs/router": "6.0.0-canary.
|
|
147
|
-
"@cedarjs/web": "6.0.0-canary.
|
|
144
|
+
"@cedarjs/auth": "6.0.0-canary.2673",
|
|
145
|
+
"@cedarjs/framework-tools": "6.0.0-canary.2673",
|
|
146
|
+
"@cedarjs/router": "6.0.0-canary.2673",
|
|
147
|
+
"@cedarjs/web": "6.0.0-canary.2673",
|
|
148
148
|
"concurrently": "9.2.1",
|
|
149
149
|
"jsdom": "27.4.0",
|
|
150
150
|
"publint": "0.3.21",
|
|
151
151
|
"typescript": "5.9.3",
|
|
152
|
-
"vitest": "
|
|
152
|
+
"vitest": "4.1.10"
|
|
153
153
|
},
|
|
154
154
|
"peerDependencies": {
|
|
155
155
|
"@cedarjs/auth": "workspace:*",
|
|
156
156
|
"@cedarjs/router": "workspace:*",
|
|
157
157
|
"@cedarjs/web": "workspace:*",
|
|
158
|
-
"vitest": "
|
|
158
|
+
"vitest": "4.1.10"
|
|
159
159
|
},
|
|
160
160
|
"peerDependenciesMeta": {
|
|
161
161
|
"vitest": {
|