@cedarjs/testing 1.0.0-canary.12780 → 1.0.0-canary.12781
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/config/jest/api/globalSetup.d.ts.map +1 -1
- package/config/jest/api/globalSetup.js +2 -1
- package/config/jest/api/jest-preset.js +1 -1
- package/config/jest/api/jest.setup.js +7 -3
- package/dist/api/vitest/CedarApiVitestEnv.d.ts.map +1 -1
- package/dist/api/vitest/CedarApiVitestEnv.js +3 -2
- package/dist/api/vitest/vitest-api.setup.js +5 -3
- package/dist/cjs/api/vitest/CedarApiVitestEnv.js +2 -1
- package/dist/cjs/api/vitest/vitest-api.setup.js +4 -2
- package/dist/cjs/config/jest/api/globalSetup.d.ts.map +1 -1
- package/dist/cjs/config/jest/api/globalSetup.js +2 -1
- package/dist/cjs/config/jest/api/jest-preset.js +1 -1
- package/dist/cjs/config/jest/api/jest.setup.js +7 -3
- package/dist/config/jest/api/globalSetup.d.ts.map +1 -1
- package/dist/config/jest/api/globalSetup.js +3 -2
- package/dist/config/jest/api/jest-preset.js +1 -1
- package/dist/config/jest/api/jest.setup.js +7 -3
- package/package.json +10 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalSetup.d.ts","sourceRoot":"","sources":["../../../../../src/config/jest/api/globalSetup.ts"],"names":[],"mappings":"AACA,OAAO,wBAAwB,CAAA;AAc/B,
|
|
1
|
+
{"version":3,"file":"globalSetup.d.ts","sourceRoot":"","sources":["../../../../../src/config/jest/api/globalSetup.ts"],"names":[],"mappings":"AACA,OAAO,wBAAwB,CAAA;AAc/B,0CAuCC"}
|
|
@@ -44,7 +44,8 @@ async function globalSetup_default() {
|
|
|
44
44
|
}
|
|
45
45
|
const defaultDb = (0, import_directUrlHelpers.getDefaultDb)(rwjsPaths.base);
|
|
46
46
|
process.env.DATABASE_URL = process.env.TEST_DATABASE_URL || defaultDb;
|
|
47
|
-
const
|
|
47
|
+
const schemaPath = await (0, import_project_config.getSchemaPath)(rwjsPaths.api.prismaConfig);
|
|
48
|
+
const result = await getSchemaWithPath(schemaPath);
|
|
48
49
|
const prismaSchema = result.schemas.map(([, content]) => content).join("\n");
|
|
49
50
|
const directUrlEnvVar = (0, import_directUrlHelpers.checkAndReplaceDirectUrl)(prismaSchema, defaultDb);
|
|
50
51
|
const command = process.env.TEST_DATABASE_STRATEGY === "reset" ? ["prisma", "migrate", "reset", "--force", "--skip-seed"] : ["prisma", "db", "push", "--force-reset", "--accept-data-loss"];
|
|
@@ -24,7 +24,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
24
|
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
25
25
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
26
26
|
var import_scenario = require("@cedarjs/testing/dist/cjs/api/scenario.js");
|
|
27
|
-
const { apiSrcPath, tearDownCachePath,
|
|
27
|
+
const { apiSrcPath, tearDownCachePath, prismaConfigPath } = global.__RWJS__TEST_IMPORTS;
|
|
28
28
|
global.defineScenario = import_scenario.defineScenario;
|
|
29
29
|
const mockContextStore = /* @__PURE__ */ new Map();
|
|
30
30
|
const mockContext = new Proxy(
|
|
@@ -59,7 +59,9 @@ const isIdenticalArray = (a, b) => {
|
|
|
59
59
|
};
|
|
60
60
|
const configureTeardown = async () => {
|
|
61
61
|
const { getDMMF, getSchemaWithPath } = require("@prisma/internals");
|
|
62
|
-
const {
|
|
62
|
+
const { getSchemaPath } = require("@cedarjs/project-config");
|
|
63
|
+
const schemaPath = await getSchemaPath(prismaConfigPath);
|
|
64
|
+
const { schemas } = await getSchemaWithPath(schemaPath);
|
|
63
65
|
const schema = await getDMMF({ datamodel: schemas });
|
|
64
66
|
const schemaModels = schema.datamodel.models.map(
|
|
65
67
|
(m) => m.dbName || m.name
|
|
@@ -75,7 +77,9 @@ const configureTeardown = async () => {
|
|
|
75
77
|
let quoteStyle;
|
|
76
78
|
const getQuoteStyle = async () => {
|
|
77
79
|
const { getConfig: getPrismaConfig, getSchemaWithPath } = require("@prisma/internals");
|
|
78
|
-
const
|
|
80
|
+
const { getSchemaPath } = require("@cedarjs/project-config");
|
|
81
|
+
const schemaPath = await getSchemaPath(prismaConfigPath);
|
|
82
|
+
const result = await getSchemaWithPath(schemaPath);
|
|
79
83
|
if (!quoteStyle) {
|
|
80
84
|
const config = await getPrismaConfig({
|
|
81
85
|
datamodel: result.schemas
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CedarApiVitestEnv.d.ts","sourceRoot":"","sources":["../../../src/api/vitest/CedarApiVitestEnv.ts"],"names":[],"mappings":"AACA,OAAO,2BAA2B,CAAA;AAElC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAQtD,QAAA,MAAM,yBAAyB,EAAE,
|
|
1
|
+
{"version":3,"file":"CedarApiVitestEnv.d.ts","sourceRoot":"","sources":["../../../src/api/vitest/CedarApiVitestEnv.ts"],"names":[],"mappings":"AACA,OAAO,2BAA2B,CAAA;AAElC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAQtD,QAAA,MAAM,yBAAyB,EAAE,WAkDhC,CAAA;AAED,eAAe,yBAAyB,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import prismaInternals from "@prisma/internals";
|
|
2
2
|
import "dotenv-defaults/config.js";
|
|
3
3
|
import execa from "execa";
|
|
4
|
-
import { getPaths } from "@cedarjs/project-config";
|
|
4
|
+
import { getPaths, getSchemaPath } from "@cedarjs/project-config";
|
|
5
5
|
import { getDefaultDb, checkAndReplaceDirectUrl } from "../directUrlHelpers.js";
|
|
6
6
|
const { getSchemaWithPath } = prismaInternals;
|
|
7
7
|
const CedarApiVitestEnvironment = {
|
|
@@ -17,7 +17,8 @@ const CedarApiVitestEnvironment = {
|
|
|
17
17
|
const cedarPaths = getPaths();
|
|
18
18
|
const defaultDb = getDefaultDb(cedarPaths.base);
|
|
19
19
|
process.env.DATABASE_URL = process.env.TEST_DATABASE_URL || defaultDb;
|
|
20
|
-
const
|
|
20
|
+
const schemaPath = await getSchemaPath(cedarPaths.api.prismaConfig);
|
|
21
|
+
const result = await getSchemaWithPath(schemaPath);
|
|
21
22
|
const prismaSchema = result.schemas.map(([, content]) => content).join("\n");
|
|
22
23
|
const directUrlEnvVar = checkAndReplaceDirectUrl(prismaSchema, defaultDb);
|
|
23
24
|
const command = process.env.TEST_DATABASE_STRATEGY === "reset" ? ["prisma", "migrate", "reset", "--force", "--skip-seed"] : ["prisma", "db", "push", "--force-reset", "--accept-data-loss"];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { afterAll, beforeEach, it, describe, vi, beforeAll } from "vitest";
|
|
4
|
-
import { getPaths } from "@cedarjs/project-config";
|
|
4
|
+
import { getPaths, getSchemaPath } from "@cedarjs/project-config";
|
|
5
5
|
import { defineScenario } from "@cedarjs/testing/api";
|
|
6
6
|
const mockContextStore = vi.hoisted(() => /* @__PURE__ */ new Map());
|
|
7
7
|
const mockContext = vi.hoisted(
|
|
@@ -107,7 +107,8 @@ async function configureTeardown() {
|
|
|
107
107
|
return;
|
|
108
108
|
}
|
|
109
109
|
const { getDMMF, getSchemaWithPath } = await import("@prisma/internals");
|
|
110
|
-
const
|
|
110
|
+
const schemaPath = await getSchemaPath(cedarPaths.api.prismaConfig);
|
|
111
|
+
const result = await getSchemaWithPath(schemaPath);
|
|
111
112
|
const schema = await getDMMF({ datamodel: result.schemas });
|
|
112
113
|
const schemaModels = schema.datamodel.models.map((m) => {
|
|
113
114
|
return m.dbName || m.name;
|
|
@@ -210,7 +211,8 @@ const wasDbImported = () => {
|
|
|
210
211
|
let quoteStyle;
|
|
211
212
|
async function getQuoteStyle() {
|
|
212
213
|
const { getConfig: getPrismaConfig, getSchemaWithPath } = await import("@prisma/internals");
|
|
213
|
-
const
|
|
214
|
+
const schemaPath = await getSchemaPath(cedarPaths.api.prismaConfig);
|
|
215
|
+
const result = await getSchemaWithPath(schemaPath);
|
|
214
216
|
if (!quoteStyle) {
|
|
215
217
|
const config = await getPrismaConfig({
|
|
216
218
|
datamodel: result.schemas
|
|
@@ -50,7 +50,8 @@ const CedarApiVitestEnvironment = {
|
|
|
50
50
|
const cedarPaths = (0, import_project_config.getPaths)();
|
|
51
51
|
const defaultDb = (0, import_directUrlHelpers.getDefaultDb)(cedarPaths.base);
|
|
52
52
|
process.env.DATABASE_URL = process.env.TEST_DATABASE_URL || defaultDb;
|
|
53
|
-
const
|
|
53
|
+
const schemaPath = await (0, import_project_config.getSchemaPath)(cedarPaths.api.prismaConfig);
|
|
54
|
+
const result = await getSchemaWithPath(schemaPath);
|
|
54
55
|
const prismaSchema = result.schemas.map(([, content]) => content).join("\n");
|
|
55
56
|
const directUrlEnvVar = (0, import_directUrlHelpers.checkAndReplaceDirectUrl)(prismaSchema, defaultDb);
|
|
56
57
|
const command = process.env.TEST_DATABASE_STRATEGY === "reset" ? ["prisma", "migrate", "reset", "--force", "--skip-seed"] : ["prisma", "db", "push", "--force-reset", "--accept-data-loss"];
|
|
@@ -130,7 +130,8 @@ async function configureTeardown() {
|
|
|
130
130
|
return;
|
|
131
131
|
}
|
|
132
132
|
const { getDMMF, getSchemaWithPath } = await import("@prisma/internals");
|
|
133
|
-
const
|
|
133
|
+
const schemaPath = await (0, import_project_config.getSchemaPath)(cedarPaths.api.prismaConfig);
|
|
134
|
+
const result = await getSchemaWithPath(schemaPath);
|
|
134
135
|
const schema = await getDMMF({ datamodel: result.schemas });
|
|
135
136
|
const schemaModels = schema.datamodel.models.map((m) => {
|
|
136
137
|
return m.dbName || m.name;
|
|
@@ -233,7 +234,8 @@ const wasDbImported = () => {
|
|
|
233
234
|
let quoteStyle;
|
|
234
235
|
async function getQuoteStyle() {
|
|
235
236
|
const { getConfig: getPrismaConfig, getSchemaWithPath } = await import("@prisma/internals");
|
|
236
|
-
const
|
|
237
|
+
const schemaPath = await (0, import_project_config.getSchemaPath)(cedarPaths.api.prismaConfig);
|
|
238
|
+
const result = await getSchemaWithPath(schemaPath);
|
|
237
239
|
if (!quoteStyle) {
|
|
238
240
|
const config = await getPrismaConfig({
|
|
239
241
|
datamodel: result.schemas
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalSetup.d.ts","sourceRoot":"","sources":["../../../../../src/config/jest/api/globalSetup.ts"],"names":[],"mappings":"AACA,OAAO,wBAAwB,CAAA;AAc/B,
|
|
1
|
+
{"version":3,"file":"globalSetup.d.ts","sourceRoot":"","sources":["../../../../../src/config/jest/api/globalSetup.ts"],"names":[],"mappings":"AACA,OAAO,wBAAwB,CAAA;AAc/B,0CAuCC"}
|
|
@@ -44,7 +44,8 @@ async function globalSetup_default() {
|
|
|
44
44
|
}
|
|
45
45
|
const defaultDb = (0, import_directUrlHelpers.getDefaultDb)(rwjsPaths.base);
|
|
46
46
|
process.env.DATABASE_URL = process.env.TEST_DATABASE_URL || defaultDb;
|
|
47
|
-
const
|
|
47
|
+
const schemaPath = await (0, import_project_config.getSchemaPath)(rwjsPaths.api.prismaConfig);
|
|
48
|
+
const result = await getSchemaWithPath(schemaPath);
|
|
48
49
|
const prismaSchema = result.schemas.map(([, content]) => content).join("\n");
|
|
49
50
|
const directUrlEnvVar = (0, import_directUrlHelpers.checkAndReplaceDirectUrl)(prismaSchema, defaultDb);
|
|
50
51
|
const command = process.env.TEST_DATABASE_STRATEGY === "reset" ? ["prisma", "migrate", "reset", "--force", "--skip-seed"] : ["prisma", "db", "push", "--force-reset", "--accept-data-loss"];
|
|
@@ -24,7 +24,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
24
|
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
25
25
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
26
26
|
var import_scenario = require("../../../api/scenario.js");
|
|
27
|
-
const { apiSrcPath, tearDownCachePath,
|
|
27
|
+
const { apiSrcPath, tearDownCachePath, prismaConfigPath } = global.__RWJS__TEST_IMPORTS;
|
|
28
28
|
global.defineScenario = import_scenario.defineScenario;
|
|
29
29
|
const mockContextStore = /* @__PURE__ */ new Map();
|
|
30
30
|
const mockContext = new Proxy(
|
|
@@ -59,7 +59,9 @@ const isIdenticalArray = (a, b) => {
|
|
|
59
59
|
};
|
|
60
60
|
const configureTeardown = async () => {
|
|
61
61
|
const { getDMMF, getSchemaWithPath } = await import("@prisma/internals");
|
|
62
|
-
const {
|
|
62
|
+
const { getSchemaPath } = await import("@cedarjs/project-config");
|
|
63
|
+
const schemaPath = await getSchemaPath(prismaConfigPath);
|
|
64
|
+
const { schemas } = await getSchemaWithPath(schemaPath);
|
|
63
65
|
const schema = await getDMMF({ datamodel: schemas });
|
|
64
66
|
const schemaModels = schema.datamodel.models.map(
|
|
65
67
|
(m) => m.dbName || m.name
|
|
@@ -75,7 +77,9 @@ const configureTeardown = async () => {
|
|
|
75
77
|
let quoteStyle;
|
|
76
78
|
const getQuoteStyle = async () => {
|
|
77
79
|
const { getConfig: getPrismaConfig, getSchemaWithPath } = await import("@prisma/internals");
|
|
78
|
-
const
|
|
80
|
+
const { getSchemaPath } = await import("@cedarjs/project-config");
|
|
81
|
+
const schemaPath = await getSchemaPath(prismaConfigPath);
|
|
82
|
+
const result = await getSchemaWithPath(schemaPath);
|
|
79
83
|
if (!quoteStyle) {
|
|
80
84
|
const config = await getPrismaConfig({
|
|
81
85
|
datamodel: result.schemas
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalSetup.d.ts","sourceRoot":"","sources":["../../../../src/config/jest/api/globalSetup.ts"],"names":[],"mappings":"AACA,OAAO,wBAAwB,CAAA;AAc/B,
|
|
1
|
+
{"version":3,"file":"globalSetup.d.ts","sourceRoot":"","sources":["../../../../src/config/jest/api/globalSetup.ts"],"names":[],"mappings":"AACA,OAAO,wBAAwB,CAAA;AAc/B,0CAuCC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import prismaInternals from "@prisma/internals";
|
|
2
2
|
import "dotenv-defaults/config";
|
|
3
3
|
import execa from "execa";
|
|
4
|
-
import { getPaths } from "@cedarjs/project-config";
|
|
4
|
+
import { getPaths, getSchemaPath } from "@cedarjs/project-config";
|
|
5
5
|
import {
|
|
6
6
|
getDefaultDb,
|
|
7
7
|
checkAndReplaceDirectUrl
|
|
@@ -14,7 +14,8 @@ async function globalSetup_default() {
|
|
|
14
14
|
}
|
|
15
15
|
const defaultDb = getDefaultDb(rwjsPaths.base);
|
|
16
16
|
process.env.DATABASE_URL = process.env.TEST_DATABASE_URL || defaultDb;
|
|
17
|
-
const
|
|
17
|
+
const schemaPath = await getSchemaPath(rwjsPaths.api.prismaConfig);
|
|
18
|
+
const result = await getSchemaWithPath(schemaPath);
|
|
18
19
|
const prismaSchema = result.schemas.map(([, content]) => content).join("\n");
|
|
19
20
|
const directUrlEnvVar = checkAndReplaceDirectUrl(prismaSchema, defaultDb);
|
|
20
21
|
const command = process.env.TEST_DATABASE_STRATEGY === "reset" ? ["prisma", "migrate", "reset", "--force", "--skip-seed"] : ["prisma", "db", "push", "--force-reset", "--accept-data-loss"];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { defineScenario } from "../../../api/scenario.js";
|
|
4
|
-
const { apiSrcPath, tearDownCachePath,
|
|
4
|
+
const { apiSrcPath, tearDownCachePath, prismaConfigPath } = global.__RWJS__TEST_IMPORTS;
|
|
5
5
|
global.defineScenario = defineScenario;
|
|
6
6
|
const mockContextStore = /* @__PURE__ */ new Map();
|
|
7
7
|
const mockContext = new Proxy(
|
|
@@ -36,7 +36,9 @@ const isIdenticalArray = (a, b) => {
|
|
|
36
36
|
};
|
|
37
37
|
const configureTeardown = async () => {
|
|
38
38
|
const { getDMMF, getSchemaWithPath } = await import("@prisma/internals");
|
|
39
|
-
const {
|
|
39
|
+
const { getSchemaPath } = await import("@cedarjs/project-config");
|
|
40
|
+
const schemaPath = await getSchemaPath(prismaConfigPath);
|
|
41
|
+
const { schemas } = await getSchemaWithPath(schemaPath);
|
|
40
42
|
const schema = await getDMMF({ datamodel: schemas });
|
|
41
43
|
const schemaModels = schema.datamodel.models.map(
|
|
42
44
|
(m) => m.dbName || m.name
|
|
@@ -52,7 +54,9 @@ const configureTeardown = async () => {
|
|
|
52
54
|
let quoteStyle;
|
|
53
55
|
const getQuoteStyle = async () => {
|
|
54
56
|
const { getConfig: getPrismaConfig, getSchemaWithPath } = await import("@prisma/internals");
|
|
55
|
-
const
|
|
57
|
+
const { getSchemaPath } = await import("@cedarjs/project-config");
|
|
58
|
+
const schemaPath = await getSchemaPath(prismaConfigPath);
|
|
59
|
+
const result = await getSchemaWithPath(schemaPath);
|
|
56
60
|
if (!quoteStyle) {
|
|
57
61
|
const config = await getPrismaConfig({
|
|
58
62
|
datamodel: result.schemas
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/testing",
|
|
3
|
-
"version": "1.0.0-canary.
|
|
3
|
+
"version": "1.0.0-canary.12781+3646d1b08",
|
|
4
4
|
"description": "Tools, wrappers and configuration for testing a Cedar project.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -119,13 +119,13 @@
|
|
|
119
119
|
"test:watch": "vitest watch"
|
|
120
120
|
},
|
|
121
121
|
"dependencies": {
|
|
122
|
-
"@cedarjs/auth": "1.0.0-canary.
|
|
123
|
-
"@cedarjs/babel-config": "1.0.0-canary.
|
|
124
|
-
"@cedarjs/context": "1.0.0-canary.
|
|
125
|
-
"@cedarjs/graphql-server": "1.0.0-canary.
|
|
126
|
-
"@cedarjs/project-config": "1.0.0-canary.
|
|
127
|
-
"@cedarjs/router": "1.0.0-canary.
|
|
128
|
-
"@cedarjs/web": "1.0.0-canary.
|
|
122
|
+
"@cedarjs/auth": "1.0.0-canary.12781",
|
|
123
|
+
"@cedarjs/babel-config": "1.0.0-canary.12781",
|
|
124
|
+
"@cedarjs/context": "1.0.0-canary.12781",
|
|
125
|
+
"@cedarjs/graphql-server": "1.0.0-canary.12781",
|
|
126
|
+
"@cedarjs/project-config": "1.0.0-canary.12781",
|
|
127
|
+
"@cedarjs/router": "1.0.0-canary.12781",
|
|
128
|
+
"@cedarjs/web": "1.0.0-canary.12781",
|
|
129
129
|
"@testing-library/jest-dom": "6.5.0",
|
|
130
130
|
"@testing-library/react": "14.3.1",
|
|
131
131
|
"@testing-library/user-event": "14.5.2",
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
"whatwg-fetch": "3.6.20"
|
|
146
146
|
},
|
|
147
147
|
"devDependencies": {
|
|
148
|
-
"@cedarjs/framework-tools": "1.0.0-canary.
|
|
148
|
+
"@cedarjs/framework-tools": "1.0.0-canary.12781",
|
|
149
149
|
"concurrently": "8.2.2",
|
|
150
150
|
"jsdom": "24.1.3",
|
|
151
151
|
"publint": "0.3.12",
|
|
@@ -164,7 +164,7 @@
|
|
|
164
164
|
"publishConfig": {
|
|
165
165
|
"access": "public"
|
|
166
166
|
},
|
|
167
|
-
"gitHead": "
|
|
167
|
+
"gitHead": "3646d1b08789be1ee38792889bc71cf331de1435",
|
|
168
168
|
"nx": {
|
|
169
169
|
"targets": {
|
|
170
170
|
"build": {
|