@cedarjs/testing 7.0.0-canary.3090 → 7.0.0-canary.3092

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":"vite-plugin-cedar-vitest-api-config.d.ts","sourceRoot":"","sources":["../../../src/api/vitest/vite-plugin-cedar-vitest-api-config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAIlC,wBAAgB,0BAA0B,IAAI,MAAM,CA4BnD"}
1
+ {"version":3,"file":"vite-plugin-cedar-vitest-api-config.d.ts","sourceRoot":"","sources":["../../../src/api/vitest/vite-plugin-cedar-vitest-api-config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAIlC,wBAAgB,0BAA0B,IAAI,MAAM,CAiCnD"}
@@ -7,7 +7,12 @@ function cedarVitestApiConfigPlugin() {
7
7
  return {
8
8
  define: getEnvVarDefinitions(),
9
9
  ssr: {
10
- noExternal: ["@cedarjs/testing"]
10
+ // `@cedarjs/tenancy` reads and writes the request context, which
11
+ // the api test setup replaces with a mock. The mock only reaches
12
+ // code Vite processes, so the tenancy runtime has to be bundled
13
+ // rather than loaded as an external dependency, or a service under
14
+ // test and its Prisma extension would see different contexts.
15
+ noExternal: ["@cedarjs/testing", "@cedarjs/tenancy"]
11
16
  },
12
17
  resolve: {
13
18
  alias: {
@@ -216,7 +216,8 @@ async function getQuoteStyle() {
216
216
  }
217
217
  async function getProjectDb() {
218
218
  const libDb = await import(`${cedarPaths.api.lib}/db`);
219
- return libDb.db;
219
+ const db = libDb.db;
220
+ return typeof db?.$withoutTenant === "function" ? db.$withoutTenant() : db;
220
221
  }
221
222
  function isIdenticalArray(a, b) {
222
223
  return JSON.stringify(a) === JSON.stringify(b);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/testing",
3
- "version": "7.0.0-canary.3090",
3
+ "version": "7.0.0-canary.3092",
4
4
  "description": "Tools, wrappers and configuration for testing a Cedar project.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -54,9 +54,9 @@
54
54
  "test:watch": "vitest watch"
55
55
  },
56
56
  "dependencies": {
57
- "@cedarjs/context": "7.0.0-canary.3090",
58
- "@cedarjs/graphql-server": "7.0.0-canary.3090",
59
- "@cedarjs/project-config": "7.0.0-canary.3090",
57
+ "@cedarjs/context": "7.0.0-canary.3092",
58
+ "@cedarjs/graphql-server": "7.0.0-canary.3092",
59
+ "@cedarjs/project-config": "7.0.0-canary.3092",
60
60
  "@testing-library/dom": "10.4.1",
61
61
  "@testing-library/jest-dom": "6.9.1",
62
62
  "@testing-library/react": "16.3.3",
@@ -73,19 +73,19 @@
73
73
  },
74
74
  "devDependencies": {
75
75
  "@arethetypeswrong/cli": "0.18.5",
76
- "@cedarjs/auth": "7.0.0-canary.3090",
77
- "@cedarjs/framework-tools": "7.0.0-canary.3090",
78
- "@cedarjs/router": "7.0.0-canary.3090",
79
- "@cedarjs/web": "7.0.0-canary.3090",
76
+ "@cedarjs/auth": "7.0.0-canary.3092",
77
+ "@cedarjs/framework-tools": "7.0.0-canary.3092",
78
+ "@cedarjs/router": "7.0.0-canary.3092",
79
+ "@cedarjs/web": "7.0.0-canary.3092",
80
80
  "concurrently": "9.2.4",
81
81
  "publint": "0.3.24",
82
82
  "typescript": "5.9.3",
83
83
  "vitest": "4.1.11"
84
84
  },
85
85
  "peerDependencies": {
86
- "@cedarjs/auth": "7.0.0-canary.3090",
87
- "@cedarjs/router": "7.0.0-canary.3090",
88
- "@cedarjs/web": "7.0.0-canary.3090",
86
+ "@cedarjs/auth": "7.0.0-canary.3092",
87
+ "@cedarjs/router": "7.0.0-canary.3092",
88
+ "@cedarjs/web": "7.0.0-canary.3092",
89
89
  "vitest": "4.1.11"
90
90
  },
91
91
  "peerDependenciesMeta": {