@cedarjs/testing 1.1.1-next.21 → 1.1.1
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 -5
- package/config/jest/api/jest-preset.js +1 -1
- package/config/jest/api/jest.setup.js +7 -11
- package/dist/api/vitest/CedarApiVitestEnv.d.ts.map +1 -1
- package/dist/api/vitest/CedarApiVitestEnv.js +3 -6
- package/dist/api/vitest/vitest-api.setup.js +7 -9
- package/dist/cjs/api/vitest/CedarApiVitestEnv.js +2 -5
- package/dist/cjs/api/vitest/vitest-api.setup.js +6 -8
- package/dist/cjs/config/jest/api/globalSetup.d.ts.map +1 -1
- package/dist/cjs/config/jest/api/globalSetup.js +2 -5
- package/dist/cjs/config/jest/api/jest-preset.js +1 -1
- package/dist/cjs/config/jest/api/jest.setup.js +7 -11
- package/dist/config/jest/api/globalSetup.d.ts.map +1 -1
- package/dist/config/jest/api/globalSetup.js +3 -6
- package/dist/config/jest/api/jest-preset.js +1 -1
- package/dist/config/jest/api/jest.setup.js +7 -11
- 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;
|
|
1
|
+
{"version":3,"file":"globalSetup.d.ts","sourceRoot":"","sources":["../../../../../src/config/jest/api/globalSetup.ts"],"names":[],"mappings":"AACA,OAAO,wBAAwB,CAAA;AAY/B,0CAmCC"}
|
|
@@ -31,12 +31,11 @@ __export(globalSetup_exports, {
|
|
|
31
31
|
default: () => globalSetup_default
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(globalSetup_exports);
|
|
34
|
-
var import_internals =
|
|
34
|
+
var import_internals = require("@prisma/internals");
|
|
35
35
|
var import_config = require("dotenv-defaults/config");
|
|
36
36
|
var import_execa = __toESM(require("execa"), 1);
|
|
37
37
|
var import_project_config = require("@cedarjs/project-config");
|
|
38
38
|
var import_directUrlHelpers = require("@cedarjs/testing/dist/cjs/api/directUrlHelpers.js");
|
|
39
|
-
const { getSchemaWithPath } = import_internals.default;
|
|
40
39
|
const rwjsPaths = (0, import_project_config.getPaths)();
|
|
41
40
|
async function globalSetup_default() {
|
|
42
41
|
if (process.env.SKIP_DB_PUSH === "1") {
|
|
@@ -44,9 +43,7 @@ async function globalSetup_default() {
|
|
|
44
43
|
}
|
|
45
44
|
const defaultDb = (0, import_directUrlHelpers.getDefaultDb)(rwjsPaths.base);
|
|
46
45
|
process.env.DATABASE_URL = process.env.TEST_DATABASE_URL || defaultDb;
|
|
47
|
-
const
|
|
48
|
-
const result = await getSchemaWithPath(schemaPath);
|
|
49
|
-
const prismaSchema = result.schemas.map(([, content]) => content).join("\n");
|
|
46
|
+
const prismaSchema = (await (0, import_internals.getSchema)(rwjsPaths.api.dbSchema)).toString();
|
|
50
47
|
const directUrlEnvVar = (0, import_directUrlHelpers.checkAndReplaceDirectUrl)(prismaSchema, defaultDb);
|
|
51
48
|
const command = process.env.TEST_DATABASE_STRATEGY === "reset" ? ["prisma", "migrate", "reset", "--force", "--skip-seed"] : ["prisma", "db", "push", "--force-reset", "--accept-data-loss"];
|
|
52
49
|
const env = {
|
|
@@ -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, dbSchemaPath } = global.__RWJS__TEST_IMPORTS;
|
|
28
28
|
global.defineScenario = import_scenario.defineScenario;
|
|
29
29
|
const mockContextStore = /* @__PURE__ */ new Map();
|
|
30
30
|
const mockContext = new Proxy(
|
|
@@ -58,11 +58,9 @@ const isIdenticalArray = (a, b) => {
|
|
|
58
58
|
return JSON.stringify(a) === JSON.stringify(b);
|
|
59
59
|
};
|
|
60
60
|
const configureTeardown = async () => {
|
|
61
|
-
const { getDMMF,
|
|
62
|
-
const
|
|
63
|
-
const
|
|
64
|
-
const { schemas } = await getSchemaWithPath(schemaPath);
|
|
65
|
-
const schema = await getDMMF({ datamodel: schemas });
|
|
61
|
+
const { getDMMF, getSchema } = require("@prisma/internals");
|
|
62
|
+
const datamodel = await getSchema(dbSchemaPath);
|
|
63
|
+
const schema = await getDMMF({ datamodel });
|
|
66
64
|
const schemaModels = schema.datamodel.models.map(
|
|
67
65
|
(m) => m.dbName || m.name
|
|
68
66
|
);
|
|
@@ -76,13 +74,11 @@ const configureTeardown = async () => {
|
|
|
76
74
|
};
|
|
77
75
|
let quoteStyle;
|
|
78
76
|
const getQuoteStyle = async () => {
|
|
79
|
-
const { getConfig: getPrismaConfig,
|
|
80
|
-
const
|
|
81
|
-
const schemaPath = await getSchemaPath(prismaConfigPath);
|
|
82
|
-
const result = await getSchemaWithPath(schemaPath);
|
|
77
|
+
const { getConfig: getPrismaConfig, getSchema } = require("@prisma/internals");
|
|
78
|
+
const datamodel = await getSchema(dbSchemaPath);
|
|
83
79
|
if (!quoteStyle) {
|
|
84
80
|
const config = await getPrismaConfig({
|
|
85
|
-
datamodel
|
|
81
|
+
datamodel
|
|
86
82
|
});
|
|
87
83
|
switch (config.datasources?.[0]?.provider) {
|
|
88
84
|
case "mysql":
|
|
@@ -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;
|
|
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;AAMtD,QAAA,MAAM,yBAAyB,EAAE,WA8ChC,CAAA;AAED,eAAe,yBAAyB,CAAA"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { getSchema } from "@prisma/internals";
|
|
2
2
|
import "dotenv-defaults/config.js";
|
|
3
3
|
import execa from "execa";
|
|
4
|
-
import { getPaths
|
|
4
|
+
import { getPaths } from "@cedarjs/project-config";
|
|
5
5
|
import { getDefaultDb, checkAndReplaceDirectUrl } from "../directUrlHelpers.js";
|
|
6
|
-
const { getSchemaWithPath } = prismaInternals;
|
|
7
6
|
const CedarApiVitestEnvironment = {
|
|
8
7
|
name: "cedar-api",
|
|
9
8
|
transformMode: "ssr",
|
|
@@ -17,9 +16,7 @@ const CedarApiVitestEnvironment = {
|
|
|
17
16
|
const cedarPaths = getPaths();
|
|
18
17
|
const defaultDb = getDefaultDb(cedarPaths.base);
|
|
19
18
|
process.env.DATABASE_URL = process.env.TEST_DATABASE_URL || defaultDb;
|
|
20
|
-
const
|
|
21
|
-
const result = await getSchemaWithPath(schemaPath);
|
|
22
|
-
const prismaSchema = result.schemas.map(([, content]) => content).join("\n");
|
|
19
|
+
const prismaSchema = (await getSchema(cedarPaths.api.dbSchema)).toString();
|
|
23
20
|
const directUrlEnvVar = checkAndReplaceDirectUrl(prismaSchema, defaultDb);
|
|
24
21
|
const command = process.env.TEST_DATABASE_STRATEGY === "reset" ? ["prisma", "migrate", "reset", "--force", "--skip-seed"] : ["prisma", "db", "push", "--force-reset", "--accept-data-loss"];
|
|
25
22
|
const directUrlDefinition = directUrlEnvVar ? { [directUrlEnvVar]: process.env[directUrlEnvVar] } : {};
|
|
@@ -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
|
|
4
|
+
import { getPaths } 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(
|
|
@@ -106,10 +106,9 @@ async function configureTeardown() {
|
|
|
106
106
|
if (!wasDbImported()) {
|
|
107
107
|
return;
|
|
108
108
|
}
|
|
109
|
-
const { getDMMF,
|
|
110
|
-
const
|
|
111
|
-
const
|
|
112
|
-
const schema = await getDMMF({ datamodel: result.schemas });
|
|
109
|
+
const { getDMMF, getSchema } = await import("@prisma/internals");
|
|
110
|
+
const datamodel = await getSchema(cedarPaths.api.dbSchema);
|
|
111
|
+
const schema = await getDMMF({ datamodel });
|
|
113
112
|
const schemaModels = schema.datamodel.models.map((m) => {
|
|
114
113
|
return m.dbName || m.name;
|
|
115
114
|
});
|
|
@@ -210,12 +209,11 @@ const wasDbImported = () => {
|
|
|
210
209
|
};
|
|
211
210
|
let quoteStyle;
|
|
212
211
|
async function getQuoteStyle() {
|
|
213
|
-
const { getConfig: getPrismaConfig,
|
|
214
|
-
const
|
|
215
|
-
const result = await getSchemaWithPath(schemaPath);
|
|
212
|
+
const { getConfig: getPrismaConfig, getSchema } = await import("@prisma/internals");
|
|
213
|
+
const datamodel = await getSchema(cedarPaths.api.dbSchema);
|
|
216
214
|
if (!quoteStyle) {
|
|
217
215
|
const config = await getPrismaConfig({
|
|
218
|
-
datamodel
|
|
216
|
+
datamodel
|
|
219
217
|
});
|
|
220
218
|
switch (config.datasources?.[0]?.provider) {
|
|
221
219
|
case "mysql":
|
|
@@ -31,12 +31,11 @@ __export(CedarApiVitestEnv_exports, {
|
|
|
31
31
|
default: () => CedarApiVitestEnv_default
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(CedarApiVitestEnv_exports);
|
|
34
|
-
var import_internals =
|
|
34
|
+
var import_internals = require("@prisma/internals");
|
|
35
35
|
var import_config = require("dotenv-defaults/config.js");
|
|
36
36
|
var import_execa = __toESM(require("execa"), 1);
|
|
37
37
|
var import_project_config = require("@cedarjs/project-config");
|
|
38
38
|
var import_directUrlHelpers = require("../directUrlHelpers.js");
|
|
39
|
-
const { getSchemaWithPath } = import_internals.default;
|
|
40
39
|
const CedarApiVitestEnvironment = {
|
|
41
40
|
name: "cedar-api",
|
|
42
41
|
transformMode: "ssr",
|
|
@@ -50,9 +49,7 @@ const CedarApiVitestEnvironment = {
|
|
|
50
49
|
const cedarPaths = (0, import_project_config.getPaths)();
|
|
51
50
|
const defaultDb = (0, import_directUrlHelpers.getDefaultDb)(cedarPaths.base);
|
|
52
51
|
process.env.DATABASE_URL = process.env.TEST_DATABASE_URL || defaultDb;
|
|
53
|
-
const
|
|
54
|
-
const result = await getSchemaWithPath(schemaPath);
|
|
55
|
-
const prismaSchema = result.schemas.map(([, content]) => content).join("\n");
|
|
52
|
+
const prismaSchema = (await (0, import_internals.getSchema)(cedarPaths.api.dbSchema)).toString();
|
|
56
53
|
const directUrlEnvVar = (0, import_directUrlHelpers.checkAndReplaceDirectUrl)(prismaSchema, defaultDb);
|
|
57
54
|
const command = process.env.TEST_DATABASE_STRATEGY === "reset" ? ["prisma", "migrate", "reset", "--force", "--skip-seed"] : ["prisma", "db", "push", "--force-reset", "--accept-data-loss"];
|
|
58
55
|
const directUrlDefinition = directUrlEnvVar ? { [directUrlEnvVar]: process.env[directUrlEnvVar] } : {};
|
|
@@ -129,10 +129,9 @@ async function configureTeardown() {
|
|
|
129
129
|
if (!wasDbImported()) {
|
|
130
130
|
return;
|
|
131
131
|
}
|
|
132
|
-
const { getDMMF,
|
|
133
|
-
const
|
|
134
|
-
const
|
|
135
|
-
const schema = await getDMMF({ datamodel: result.schemas });
|
|
132
|
+
const { getDMMF, getSchema } = await import("@prisma/internals");
|
|
133
|
+
const datamodel = await getSchema(cedarPaths.api.dbSchema);
|
|
134
|
+
const schema = await getDMMF({ datamodel });
|
|
136
135
|
const schemaModels = schema.datamodel.models.map((m) => {
|
|
137
136
|
return m.dbName || m.name;
|
|
138
137
|
});
|
|
@@ -233,12 +232,11 @@ const wasDbImported = () => {
|
|
|
233
232
|
};
|
|
234
233
|
let quoteStyle;
|
|
235
234
|
async function getQuoteStyle() {
|
|
236
|
-
const { getConfig: getPrismaConfig,
|
|
237
|
-
const
|
|
238
|
-
const result = await getSchemaWithPath(schemaPath);
|
|
235
|
+
const { getConfig: getPrismaConfig, getSchema } = await import("@prisma/internals");
|
|
236
|
+
const datamodel = await getSchema(cedarPaths.api.dbSchema);
|
|
239
237
|
if (!quoteStyle) {
|
|
240
238
|
const config = await getPrismaConfig({
|
|
241
|
-
datamodel
|
|
239
|
+
datamodel
|
|
242
240
|
});
|
|
243
241
|
switch (config.datasources?.[0]?.provider) {
|
|
244
242
|
case "mysql":
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalSetup.d.ts","sourceRoot":"","sources":["../../../../../src/config/jest/api/globalSetup.ts"],"names":[],"mappings":"AACA,OAAO,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"globalSetup.d.ts","sourceRoot":"","sources":["../../../../../src/config/jest/api/globalSetup.ts"],"names":[],"mappings":"AACA,OAAO,wBAAwB,CAAA;AAY/B,0CAmCC"}
|
|
@@ -31,12 +31,11 @@ __export(globalSetup_exports, {
|
|
|
31
31
|
default: () => globalSetup_default
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(globalSetup_exports);
|
|
34
|
-
var import_internals =
|
|
34
|
+
var import_internals = require("@prisma/internals");
|
|
35
35
|
var import_config = require("dotenv-defaults/config");
|
|
36
36
|
var import_execa = __toESM(require("execa"), 1);
|
|
37
37
|
var import_project_config = require("@cedarjs/project-config");
|
|
38
38
|
var import_directUrlHelpers = require("../../../api/directUrlHelpers.js");
|
|
39
|
-
const { getSchemaWithPath } = import_internals.default;
|
|
40
39
|
const rwjsPaths = (0, import_project_config.getPaths)();
|
|
41
40
|
async function globalSetup_default() {
|
|
42
41
|
if (process.env.SKIP_DB_PUSH === "1") {
|
|
@@ -44,9 +43,7 @@ async function globalSetup_default() {
|
|
|
44
43
|
}
|
|
45
44
|
const defaultDb = (0, import_directUrlHelpers.getDefaultDb)(rwjsPaths.base);
|
|
46
45
|
process.env.DATABASE_URL = process.env.TEST_DATABASE_URL || defaultDb;
|
|
47
|
-
const
|
|
48
|
-
const result = await getSchemaWithPath(schemaPath);
|
|
49
|
-
const prismaSchema = result.schemas.map(([, content]) => content).join("\n");
|
|
46
|
+
const prismaSchema = (await (0, import_internals.getSchema)(rwjsPaths.api.dbSchema)).toString();
|
|
50
47
|
const directUrlEnvVar = (0, import_directUrlHelpers.checkAndReplaceDirectUrl)(prismaSchema, defaultDb);
|
|
51
48
|
const command = process.env.TEST_DATABASE_STRATEGY === "reset" ? ["prisma", "migrate", "reset", "--force", "--skip-seed"] : ["prisma", "db", "push", "--force-reset", "--accept-data-loss"];
|
|
52
49
|
const env = {
|
|
@@ -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, dbSchemaPath } = global.__RWJS__TEST_IMPORTS;
|
|
28
28
|
global.defineScenario = import_scenario.defineScenario;
|
|
29
29
|
const mockContextStore = /* @__PURE__ */ new Map();
|
|
30
30
|
const mockContext = new Proxy(
|
|
@@ -58,11 +58,9 @@ const isIdenticalArray = (a, b) => {
|
|
|
58
58
|
return JSON.stringify(a) === JSON.stringify(b);
|
|
59
59
|
};
|
|
60
60
|
const configureTeardown = async () => {
|
|
61
|
-
const { getDMMF,
|
|
62
|
-
const
|
|
63
|
-
const
|
|
64
|
-
const { schemas } = await getSchemaWithPath(schemaPath);
|
|
65
|
-
const schema = await getDMMF({ datamodel: schemas });
|
|
61
|
+
const { getDMMF, getSchema } = await import("@prisma/internals");
|
|
62
|
+
const datamodel = await getSchema(dbSchemaPath);
|
|
63
|
+
const schema = await getDMMF({ datamodel });
|
|
66
64
|
const schemaModels = schema.datamodel.models.map(
|
|
67
65
|
(m) => m.dbName || m.name
|
|
68
66
|
);
|
|
@@ -76,13 +74,11 @@ const configureTeardown = async () => {
|
|
|
76
74
|
};
|
|
77
75
|
let quoteStyle;
|
|
78
76
|
const getQuoteStyle = async () => {
|
|
79
|
-
const { getConfig: getPrismaConfig,
|
|
80
|
-
const
|
|
81
|
-
const schemaPath = await getSchemaPath(prismaConfigPath);
|
|
82
|
-
const result = await getSchemaWithPath(schemaPath);
|
|
77
|
+
const { getConfig: getPrismaConfig, getSchema } = await import("@prisma/internals");
|
|
78
|
+
const datamodel = await getSchema(dbSchemaPath);
|
|
83
79
|
if (!quoteStyle) {
|
|
84
80
|
const config = await getPrismaConfig({
|
|
85
|
-
datamodel
|
|
81
|
+
datamodel
|
|
86
82
|
});
|
|
87
83
|
switch (config.datasources?.[0]?.provider) {
|
|
88
84
|
case "mysql":
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalSetup.d.ts","sourceRoot":"","sources":["../../../../src/config/jest/api/globalSetup.ts"],"names":[],"mappings":"AACA,OAAO,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"globalSetup.d.ts","sourceRoot":"","sources":["../../../../src/config/jest/api/globalSetup.ts"],"names":[],"mappings":"AACA,OAAO,wBAAwB,CAAA;AAY/B,0CAmCC"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { getSchema } from "@prisma/internals";
|
|
2
2
|
import "dotenv-defaults/config";
|
|
3
3
|
import execa from "execa";
|
|
4
|
-
import { getPaths
|
|
4
|
+
import { getPaths } from "@cedarjs/project-config";
|
|
5
5
|
import {
|
|
6
6
|
getDefaultDb,
|
|
7
7
|
checkAndReplaceDirectUrl
|
|
8
8
|
} from "../../../api/directUrlHelpers.js";
|
|
9
|
-
const { getSchemaWithPath } = prismaInternals;
|
|
10
9
|
const rwjsPaths = getPaths();
|
|
11
10
|
async function globalSetup_default() {
|
|
12
11
|
if (process.env.SKIP_DB_PUSH === "1") {
|
|
@@ -14,9 +13,7 @@ async function globalSetup_default() {
|
|
|
14
13
|
}
|
|
15
14
|
const defaultDb = getDefaultDb(rwjsPaths.base);
|
|
16
15
|
process.env.DATABASE_URL = process.env.TEST_DATABASE_URL || defaultDb;
|
|
17
|
-
const
|
|
18
|
-
const result = await getSchemaWithPath(schemaPath);
|
|
19
|
-
const prismaSchema = result.schemas.map(([, content]) => content).join("\n");
|
|
16
|
+
const prismaSchema = (await getSchema(rwjsPaths.api.dbSchema)).toString();
|
|
20
17
|
const directUrlEnvVar = checkAndReplaceDirectUrl(prismaSchema, defaultDb);
|
|
21
18
|
const command = process.env.TEST_DATABASE_STRATEGY === "reset" ? ["prisma", "migrate", "reset", "--force", "--skip-seed"] : ["prisma", "db", "push", "--force-reset", "--accept-data-loss"];
|
|
22
19
|
const env = {
|
|
@@ -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, dbSchemaPath } = global.__RWJS__TEST_IMPORTS;
|
|
5
5
|
global.defineScenario = defineScenario;
|
|
6
6
|
const mockContextStore = /* @__PURE__ */ new Map();
|
|
7
7
|
const mockContext = new Proxy(
|
|
@@ -35,11 +35,9 @@ const isIdenticalArray = (a, b) => {
|
|
|
35
35
|
return JSON.stringify(a) === JSON.stringify(b);
|
|
36
36
|
};
|
|
37
37
|
const configureTeardown = async () => {
|
|
38
|
-
const { getDMMF,
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const { schemas } = await getSchemaWithPath(schemaPath);
|
|
42
|
-
const schema = await getDMMF({ datamodel: schemas });
|
|
38
|
+
const { getDMMF, getSchema } = await import("@prisma/internals");
|
|
39
|
+
const datamodel = await getSchema(dbSchemaPath);
|
|
40
|
+
const schema = await getDMMF({ datamodel });
|
|
43
41
|
const schemaModels = schema.datamodel.models.map(
|
|
44
42
|
(m) => m.dbName || m.name
|
|
45
43
|
);
|
|
@@ -53,13 +51,11 @@ const configureTeardown = async () => {
|
|
|
53
51
|
};
|
|
54
52
|
let quoteStyle;
|
|
55
53
|
const getQuoteStyle = async () => {
|
|
56
|
-
const { getConfig: getPrismaConfig,
|
|
57
|
-
const
|
|
58
|
-
const schemaPath = await getSchemaPath(prismaConfigPath);
|
|
59
|
-
const result = await getSchemaWithPath(schemaPath);
|
|
54
|
+
const { getConfig: getPrismaConfig, getSchema } = await import("@prisma/internals");
|
|
55
|
+
const datamodel = await getSchema(dbSchemaPath);
|
|
60
56
|
if (!quoteStyle) {
|
|
61
57
|
const config = await getPrismaConfig({
|
|
62
|
-
datamodel
|
|
58
|
+
datamodel
|
|
63
59
|
});
|
|
64
60
|
switch (config.datasources?.[0]?.provider) {
|
|
65
61
|
case "mysql":
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/testing",
|
|
3
|
-
"version": "1.1.1
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Tools, wrappers and configuration for testing a CedarJS 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.1.1
|
|
123
|
-
"@cedarjs/babel-config": "1.1.1
|
|
124
|
-
"@cedarjs/context": "1.1.1
|
|
125
|
-
"@cedarjs/graphql-server": "1.1.1
|
|
126
|
-
"@cedarjs/project-config": "1.1.1
|
|
127
|
-
"@cedarjs/router": "1.1.1
|
|
128
|
-
"@cedarjs/web": "1.1.1
|
|
122
|
+
"@cedarjs/auth": "1.1.1",
|
|
123
|
+
"@cedarjs/babel-config": "1.1.1",
|
|
124
|
+
"@cedarjs/context": "1.1.1",
|
|
125
|
+
"@cedarjs/graphql-server": "1.1.1",
|
|
126
|
+
"@cedarjs/project-config": "1.1.1",
|
|
127
|
+
"@cedarjs/router": "1.1.1",
|
|
128
|
+
"@cedarjs/web": "1.1.1",
|
|
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.1.1
|
|
148
|
+
"@cedarjs/framework-tools": "1.1.1",
|
|
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": "0c21e9ed1de0c7302295f3ca284924e48dd81afe",
|
|
168
168
|
"nx": {
|
|
169
169
|
"targets": {
|
|
170
170
|
"build": {
|