@cedarjs/testing 9.0.0-canary.1784 → 9.0.0-canary.3124

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.
Files changed (244) hide show
  1. package/dist/api/checkTestDatabase.d.ts +23 -0
  2. package/dist/api/checkTestDatabase.d.ts.map +1 -0
  3. package/dist/api/checkTestDatabase.js +44 -0
  4. package/dist/api/index.d.ts +0 -1
  5. package/dist/api/index.d.ts.map +1 -1
  6. package/dist/api/index.js +0 -1
  7. package/dist/api/vitest/CedarApiVitestEnv.d.ts.map +1 -1
  8. package/dist/api/vitest/CedarApiVitestEnv.js +22 -17
  9. package/dist/api/vitest/teardown.d.ts +18 -0
  10. package/dist/api/vitest/teardown.d.ts.map +1 -0
  11. package/dist/api/vitest/teardown.js +43 -0
  12. package/dist/api/vitest/vite-plugin-cedar-vitest-api-config.d.ts.map +1 -1
  13. package/dist/api/vitest/vite-plugin-cedar-vitest-api-config.js +13 -8
  14. package/dist/api/vitest/vitest-api.setup.d.ts.map +1 -1
  15. package/dist/api/vitest/vitest-api.setup.js +18 -33
  16. package/dist/cache/index.js +1 -1
  17. package/dist/web/MockParamsProvider.d.ts.map +1 -1
  18. package/dist/web/MockParamsProvider.js +10 -1
  19. package/dist/web/MockProviders.js +12 -6
  20. package/dist/web/MockRouter.d.ts.map +1 -1
  21. package/dist/web/mockRequests.d.ts +74 -18
  22. package/dist/web/mockRequests.d.ts.map +1 -1
  23. package/dist/web/mockRequests.js +118 -39
  24. package/dist/web/vitest/index.d.ts +1 -0
  25. package/dist/web/vitest/index.d.ts.map +1 -1
  26. package/dist/web/vitest/index.js +2 -0
  27. package/dist/web/vitest/vite-plugin-cedar-vitest-web-config.d.ts +12 -0
  28. package/dist/web/vitest/vite-plugin-cedar-vitest-web-config.d.ts.map +1 -0
  29. package/dist/web/vitest/vite-plugin-cedar-vitest-web-config.js +16 -0
  30. package/dist/web/vitest/vite-plugin-cedarjs-router-import-transform.d.ts.map +1 -1
  31. package/dist/web/vitest/vite-plugin-create-auth-import-transform.d.ts.map +1 -1
  32. package/dist/web/vitest/vitest-web.setup.d.ts +2 -0
  33. package/dist/web/vitest/vitest-web.setup.d.ts.map +1 -0
  34. package/dist/web/vitest/vitest-web.setup.js +18 -0
  35. package/package.json +41 -106
  36. package/LICENSE +0 -21
  37. package/config/jest/api/RedwoodApiJestEnv.d.ts +0 -11
  38. package/config/jest/api/RedwoodApiJestEnv.d.ts.map +0 -1
  39. package/config/jest/api/RedwoodApiJestEnv.js +0 -48
  40. package/config/jest/api/apiBabelConfig.d.ts +0 -5
  41. package/config/jest/api/apiBabelConfig.d.ts.map +0 -1
  42. package/config/jest/api/apiBabelConfig.js +0 -34
  43. package/config/jest/api/globalSetup.d.ts +0 -3
  44. package/config/jest/api/globalSetup.d.ts.map +0 -1
  45. package/config/jest/api/globalSetup.js +0 -63
  46. package/config/jest/api/index.d.ts +0 -3
  47. package/config/jest/api/index.d.ts.map +0 -1
  48. package/config/jest/api/index.js +0 -25
  49. package/config/jest/api/jest-preset.d.ts +0 -4
  50. package/config/jest/api/jest-preset.d.ts.map +0 -1
  51. package/config/jest/api/jest-preset.js +0 -99
  52. package/config/jest/api/jest.setup.d.ts +0 -2
  53. package/config/jest/api/jest.setup.d.ts.map +0 -1
  54. package/config/jest/api/jest.setup.js +0 -271
  55. package/config/jest/api/package.json +0 -8
  56. package/config/jest/babelPlugins/babel-plugin-redwood-cell.d.ts +0 -11
  57. package/config/jest/babelPlugins/babel-plugin-redwood-cell.d.ts.map +0 -1
  58. package/config/jest/babelPlugins/babel-plugin-redwood-cell.js +0 -121
  59. package/config/jest/jest-serial-runner.d.ts +0 -8
  60. package/config/jest/jest-serial-runner.d.ts.map +0 -1
  61. package/config/jest/jest-serial-runner.js +0 -37
  62. package/config/jest/web/RedwoodWebJestEnv.d.ts +0 -6
  63. package/config/jest/web/RedwoodWebJestEnv.d.ts.map +0 -1
  64. package/config/jest/web/RedwoodWebJestEnv.js +0 -38
  65. package/config/jest/web/index.d.ts +0 -3
  66. package/config/jest/web/index.d.ts.map +0 -1
  67. package/config/jest/web/index.js +0 -25
  68. package/config/jest/web/jest-preset.d.ts +0 -4
  69. package/config/jest/web/jest-preset.d.ts.map +0 -1
  70. package/config/jest/web/jest-preset.js +0 -119
  71. package/config/jest/web/jest.setup.d.ts +0 -8
  72. package/config/jest/web/jest.setup.d.ts.map +0 -1
  73. package/config/jest/web/jest.setup.js +0 -22
  74. package/config/jest/web/package.json +0 -8
  75. package/config/jest/web/resolver.d.ts +0 -4
  76. package/config/jest/web/resolver.d.ts.map +0 -1
  77. package/config/jest/web/resolver.js +0 -30
  78. package/config/jest/web/webBabelConfig.d.ts +0 -10
  79. package/config/jest/web/webBabelConfig.d.ts.map +0 -1
  80. package/config/jest/web/webBabelConfig.js +0 -48
  81. package/config/package.json +0 -1
  82. package/dist/api/directUrlHelpers.d.ts +0 -3
  83. package/dist/api/directUrlHelpers.d.ts.map +0 -1
  84. package/dist/api/directUrlHelpers.js +0 -25
  85. package/dist/cjs/api/apiFunction.d.ts +0 -37
  86. package/dist/cjs/api/apiFunction.d.ts.map +0 -1
  87. package/dist/cjs/api/apiFunction.js +0 -89
  88. package/dist/cjs/api/directUrlHelpers.d.ts +0 -3
  89. package/dist/cjs/api/directUrlHelpers.d.ts.map +0 -1
  90. package/dist/cjs/api/directUrlHelpers.js +0 -60
  91. package/dist/cjs/api/directive.d.ts +0 -51
  92. package/dist/cjs/api/directive.d.ts.map +0 -1
  93. package/dist/cjs/api/directive.js +0 -77
  94. package/dist/cjs/api/index.d.ts +0 -5
  95. package/dist/cjs/api/index.d.ts.map +0 -1
  96. package/dist/cjs/api/index.js +0 -28
  97. package/dist/cjs/api/mockContext.d.ts +0 -5
  98. package/dist/cjs/api/mockContext.d.ts.map +0 -1
  99. package/dist/cjs/api/mockContext.js +0 -58
  100. package/dist/cjs/api/scenario.d.ts +0 -108
  101. package/dist/cjs/api/scenario.d.ts.map +0 -1
  102. package/dist/cjs/api/scenario.js +0 -30
  103. package/dist/cjs/api/vitest/CedarApiVitestEnv.js +0 -73
  104. package/dist/cjs/api/vitest/index.js +0 -34
  105. package/dist/cjs/api/vitest/vite-plugin-auto-import.js +0 -71
  106. package/dist/cjs/api/vitest/vite-plugin-cedar-vitest-api-config.js +0 -69
  107. package/dist/cjs/api/vitest/vite-plugin-track-db-imports.js +0 -47
  108. package/dist/cjs/api/vitest/vitest-api.setup.js +0 -272
  109. package/dist/cjs/cache/index.d.ts +0 -50
  110. package/dist/cjs/cache/index.d.ts.map +0 -1
  111. package/dist/cjs/cache/index.js +0 -104
  112. package/dist/cjs/config/jest/api/RedwoodApiJestEnv.d.ts +0 -11
  113. package/dist/cjs/config/jest/api/RedwoodApiJestEnv.d.ts.map +0 -1
  114. package/dist/cjs/config/jest/api/RedwoodApiJestEnv.js +0 -48
  115. package/dist/cjs/config/jest/api/apiBabelConfig.d.ts +0 -5
  116. package/dist/cjs/config/jest/api/apiBabelConfig.d.ts.map +0 -1
  117. package/dist/cjs/config/jest/api/apiBabelConfig.js +0 -34
  118. package/dist/cjs/config/jest/api/globalSetup.d.ts +0 -3
  119. package/dist/cjs/config/jest/api/globalSetup.d.ts.map +0 -1
  120. package/dist/cjs/config/jest/api/globalSetup.js +0 -63
  121. package/dist/cjs/config/jest/api/index.d.ts +0 -3
  122. package/dist/cjs/config/jest/api/index.d.ts.map +0 -1
  123. package/dist/cjs/config/jest/api/index.js +0 -25
  124. package/dist/cjs/config/jest/api/jest-preset.d.ts +0 -4
  125. package/dist/cjs/config/jest/api/jest-preset.d.ts.map +0 -1
  126. package/dist/cjs/config/jest/api/jest-preset.js +0 -99
  127. package/dist/cjs/config/jest/api/jest.setup.d.ts +0 -2
  128. package/dist/cjs/config/jest/api/jest.setup.d.ts.map +0 -1
  129. package/dist/cjs/config/jest/api/jest.setup.js +0 -271
  130. package/dist/cjs/config/jest/babelPlugins/babel-plugin-redwood-cell.d.ts +0 -11
  131. package/dist/cjs/config/jest/babelPlugins/babel-plugin-redwood-cell.d.ts.map +0 -1
  132. package/dist/cjs/config/jest/babelPlugins/babel-plugin-redwood-cell.js +0 -121
  133. package/dist/cjs/config/jest/jest-serial-runner.d.ts +0 -8
  134. package/dist/cjs/config/jest/jest-serial-runner.d.ts.map +0 -1
  135. package/dist/cjs/config/jest/jest-serial-runner.js +0 -37
  136. package/dist/cjs/config/jest/web/RedwoodWebJestEnv.d.ts +0 -6
  137. package/dist/cjs/config/jest/web/RedwoodWebJestEnv.d.ts.map +0 -1
  138. package/dist/cjs/config/jest/web/RedwoodWebJestEnv.js +0 -38
  139. package/dist/cjs/config/jest/web/index.d.ts +0 -3
  140. package/dist/cjs/config/jest/web/index.d.ts.map +0 -1
  141. package/dist/cjs/config/jest/web/index.js +0 -25
  142. package/dist/cjs/config/jest/web/jest-preset.d.ts +0 -4
  143. package/dist/cjs/config/jest/web/jest-preset.d.ts.map +0 -1
  144. package/dist/cjs/config/jest/web/jest-preset.js +0 -119
  145. package/dist/cjs/config/jest/web/jest.setup.d.ts +0 -8
  146. package/dist/cjs/config/jest/web/jest.setup.d.ts.map +0 -1
  147. package/dist/cjs/config/jest/web/jest.setup.js +0 -22
  148. package/dist/cjs/config/jest/web/resolver.d.ts +0 -4
  149. package/dist/cjs/config/jest/web/resolver.d.ts.map +0 -1
  150. package/dist/cjs/config/jest/web/resolver.js +0 -30
  151. package/dist/cjs/config/jest/web/webBabelConfig.d.ts +0 -10
  152. package/dist/cjs/config/jest/web/webBabelConfig.d.ts.map +0 -1
  153. package/dist/cjs/config/jest/web/webBabelConfig.js +0 -48
  154. package/dist/cjs/package.json +0 -1
  155. package/dist/cjs/web/MockParamsProvider.d.ts +0 -7
  156. package/dist/cjs/web/MockParamsProvider.d.ts.map +0 -1
  157. package/dist/cjs/web/MockParamsProvider.js +0 -44
  158. package/dist/cjs/web/MockProviders.d.ts +0 -5
  159. package/dist/cjs/web/MockProviders.d.ts.map +0 -1
  160. package/dist/cjs/web/MockProviders.js +0 -60
  161. package/dist/cjs/web/MockRouter.d.ts +0 -11
  162. package/dist/cjs/web/MockRouter.d.ts.map +0 -1
  163. package/dist/cjs/web/MockRouter.js +0 -48
  164. package/dist/cjs/web/customRender.d.ts +0 -6
  165. package/dist/cjs/web/customRender.d.ts.map +0 -1
  166. package/dist/cjs/web/customRender.js +0 -54
  167. package/dist/cjs/web/fileMock.d.ts +0 -9
  168. package/dist/cjs/web/fileMock.d.ts.map +0 -1
  169. package/dist/cjs/web/fileMock.js +0 -24
  170. package/dist/cjs/web/findCellMocks.d.ts +0 -2
  171. package/dist/cjs/web/findCellMocks.d.ts.map +0 -1
  172. package/dist/cjs/web/findCellMocks.js +0 -45
  173. package/dist/cjs/web/globRoutesImporter.d.ts +0 -13
  174. package/dist/cjs/web/globRoutesImporter.d.ts.map +0 -1
  175. package/dist/cjs/web/globRoutesImporter.js +0 -46
  176. package/dist/cjs/web/global.d.ts +0 -6
  177. package/dist/cjs/web/global.d.ts.map +0 -1
  178. package/dist/cjs/web/global.js +0 -1
  179. package/dist/cjs/web/index.d.ts +0 -6
  180. package/dist/cjs/web/index.d.ts.map +0 -1
  181. package/dist/cjs/web/index.js +0 -41
  182. package/dist/cjs/web/mockAuth.d.ts +0 -29
  183. package/dist/cjs/web/mockAuth.d.ts.map +0 -1
  184. package/dist/cjs/web/mockAuth.js +0 -89
  185. package/dist/cjs/web/mockRequests.d.ts +0 -30
  186. package/dist/cjs/web/mockRequests.d.ts.map +0 -1
  187. package/dist/cjs/web/mockRequests.js +0 -139
  188. package/dist/cjs/web/vitest/index.d.ts +0 -4
  189. package/dist/cjs/web/vitest/index.d.ts.map +0 -1
  190. package/dist/cjs/web/vitest/index.js +0 -34
  191. package/dist/cjs/web/vitest/vite-plugin-auto-import.d.ts +0 -2
  192. package/dist/cjs/web/vitest/vite-plugin-auto-import.d.ts.map +0 -1
  193. package/dist/cjs/web/vitest/vite-plugin-auto-import.js +0 -60
  194. package/dist/cjs/web/vitest/vite-plugin-cedarjs-router-import-transform.d.ts +0 -7
  195. package/dist/cjs/web/vitest/vite-plugin-cedarjs-router-import-transform.d.ts.map +0 -1
  196. package/dist/cjs/web/vitest/vite-plugin-cedarjs-router-import-transform.js +0 -42
  197. package/dist/cjs/web/vitest/vite-plugin-create-auth-import-transform.d.ts +0 -3
  198. package/dist/cjs/web/vitest/vite-plugin-create-auth-import-transform.d.ts.map +0 -1
  199. package/dist/cjs/web/vitest/vite-plugin-create-auth-import-transform.js +0 -43
  200. package/dist/config/jest/api/RedwoodApiJestEnv.d.ts +0 -11
  201. package/dist/config/jest/api/RedwoodApiJestEnv.d.ts.map +0 -1
  202. package/dist/config/jest/api/RedwoodApiJestEnv.js +0 -28
  203. package/dist/config/jest/api/apiBabelConfig.d.ts +0 -5
  204. package/dist/config/jest/api/apiBabelConfig.d.ts.map +0 -1
  205. package/dist/config/jest/api/apiBabelConfig.js +0 -18
  206. package/dist/config/jest/api/globalSetup.d.ts +0 -3
  207. package/dist/config/jest/api/globalSetup.d.ts.map +0 -1
  208. package/dist/config/jest/api/globalSetup.js +0 -36
  209. package/dist/config/jest/api/index.d.ts +0 -3
  210. package/dist/config/jest/api/index.d.ts.map +0 -1
  211. package/dist/config/jest/api/index.js +0 -11
  212. package/dist/config/jest/api/jest-preset.d.ts +0 -4
  213. package/dist/config/jest/api/jest-preset.d.ts.map +0 -1
  214. package/dist/config/jest/api/jest-preset.js +0 -69
  215. package/dist/config/jest/api/jest.setup.d.ts +0 -2
  216. package/dist/config/jest/api/jest.setup.d.ts.map +0 -1
  217. package/dist/config/jest/api/jest.setup.js +0 -248
  218. package/dist/config/jest/babelPlugins/babel-plugin-redwood-cell.d.ts +0 -11
  219. package/dist/config/jest/babelPlugins/babel-plugin-redwood-cell.d.ts.map +0 -1
  220. package/dist/config/jest/babelPlugins/babel-plugin-redwood-cell.js +0 -101
  221. package/dist/config/jest/jest-serial-runner.d.ts +0 -8
  222. package/dist/config/jest/jest-serial-runner.d.ts.map +0 -1
  223. package/dist/config/jest/jest-serial-runner.js +0 -23
  224. package/dist/config/jest/web/RedwoodWebJestEnv.d.ts +0 -6
  225. package/dist/config/jest/web/RedwoodWebJestEnv.d.ts.map +0 -1
  226. package/dist/config/jest/web/RedwoodWebJestEnv.js +0 -18
  227. package/dist/config/jest/web/index.d.ts +0 -3
  228. package/dist/config/jest/web/index.d.ts.map +0 -1
  229. package/dist/config/jest/web/index.js +0 -11
  230. package/dist/config/jest/web/jest-preset.d.ts +0 -4
  231. package/dist/config/jest/web/jest-preset.d.ts.map +0 -1
  232. package/dist/config/jest/web/jest-preset.js +0 -89
  233. package/dist/config/jest/web/jest.setup.d.ts +0 -8
  234. package/dist/config/jest/web/jest.setup.d.ts.map +0 -1
  235. package/dist/config/jest/web/jest.setup.js +0 -28
  236. package/dist/config/jest/web/resolver.d.ts +0 -4
  237. package/dist/config/jest/web/resolver.d.ts.map +0 -1
  238. package/dist/config/jest/web/resolver.js +0 -38
  239. package/dist/config/jest/web/webBabelConfig.d.ts +0 -10
  240. package/dist/config/jest/web/webBabelConfig.d.ts.map +0 -1
  241. package/dist/config/jest/web/webBabelConfig.js +0 -18
  242. package/dist/web/fileMock.d.ts +0 -9
  243. package/dist/web/fileMock.d.ts.map +0 -1
  244. package/dist/web/fileMock.js +0 -4
@@ -1,47 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var vite_plugin_track_db_imports_exports = {};
20
- __export(vite_plugin_track_db_imports_exports, {
21
- trackDbImportsPlugin: () => trackDbImportsPlugin
22
- });
23
- module.exports = __toCommonJS(vite_plugin_track_db_imports_exports);
24
- function trackDbImportsPlugin() {
25
- return {
26
- name: "db-import-tracker",
27
- transform(code, id) {
28
- if (id.match(/\/api\/src\/lib\/db\.(js|ts)$/) && code.includes("PrismaClient")) {
29
- return code + `
30
- ;if (typeof globalThis !== "undefined") {
31
- globalThis.__cedarjs_db_imported__ = true;
32
- } else {
33
- throw new Error(
34
- "vite-plugin-track-db-imports: globalThis is undefined. " +
35
- "This is an error with CedarJS"
36
- );
37
- }
38
- `;
39
- }
40
- return code;
41
- }
42
- };
43
- }
44
- // Annotate the CommonJS export names for ESM import in node:
45
- 0 && (module.exports = {
46
- trackDbImportsPlugin
47
- });
@@ -1,272 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") {
10
- for (let key of __getOwnPropNames(from))
11
- if (!__hasOwnProp.call(to, key) && key !== except)
12
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
- }
14
- return to;
15
- };
16
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
- // If the importer is in node compatibility mode or this is not an ESM
18
- // file that has been converted to a CommonJS file using a Babel-
19
- // compatible transform (i.e. "__esModule" has not been set), then set
20
- // "default" to the CommonJS "module.exports" for node compatibility.
21
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
- mod
23
- ));
24
- var import_node_fs = __toESM(require("node:fs"), 1);
25
- var import_node_path = __toESM(require("node:path"), 1);
26
- var import_vitest = require("vitest");
27
- var import_project_config = require("@cedarjs/project-config");
28
- var import_api = require("@cedarjs/testing/api");
29
- const mockContextStore = import_vitest.vi.hoisted(() => /* @__PURE__ */ new Map());
30
- const mockContext = import_vitest.vi.hoisted(
31
- () => new Proxy(
32
- {},
33
- {
34
- get: (_target, prop) => {
35
- if (prop === "toJSON") {
36
- return () => mockContextStore.get("context");
37
- }
38
- return mockContextStore.get("context")[prop];
39
- },
40
- set: (_target, prop, value) => {
41
- const ctx = mockContextStore.get("context");
42
- ctx[prop] = value;
43
- return true;
44
- }
45
- }
46
- )
47
- );
48
- import_vitest.vi.mock("@cedarjs/context", () => {
49
- return {
50
- context: mockContext,
51
- setContext: (newContext) => {
52
- mockContextStore.set("context", newContext);
53
- }
54
- };
55
- });
56
- (0, import_vitest.beforeEach)(() => {
57
- mockContextStore.set("context", {});
58
- });
59
- globalThis.mockCurrentUser = (currentUser) => {
60
- mockContextStore.set("context", { currentUser });
61
- };
62
- globalThis.defineScenario = import_api.defineScenario;
63
- const cedarPaths = (0, import_project_config.getPaths)();
64
- const FOREIGN_KEY_ERRORS = [1451, 1811, 23503];
65
- const TEARDOWN_CACHE_PATH = import_node_path.default.join(
66
- cedarPaths.generated.base,
67
- "scenarioTeardown.json"
68
- );
69
- const DEFAULT_SCENARIO = "standard";
70
- let teardownOrder = [];
71
- let originalTeardownOrder = [];
72
- function buildScenario(itFunc) {
73
- return (...args) => {
74
- let scenarioName;
75
- let testName;
76
- let testFunc;
77
- if (args.length === 3) {
78
- ;
79
- [scenarioName, testName, testFunc] = args;
80
- } else if (args.length === 2) {
81
- scenarioName = DEFAULT_SCENARIO;
82
- [testName, testFunc] = args;
83
- } else {
84
- throw new Error("scenario() requires 2 or 3 arguments");
85
- }
86
- return itFunc(testName, async (ctx) => {
87
- const testPath = ctx.task.file.filepath;
88
- const { scenario } = await loadScenarios(testPath, scenarioName);
89
- const scenarioData = await seedScenario(scenario);
90
- try {
91
- const result = await testFunc(scenarioData);
92
- return result;
93
- } finally {
94
- await teardown();
95
- }
96
- });
97
- };
98
- }
99
- function buildDescribeScenario(describeFunc) {
100
- return (...args) => {
101
- let scenarioName;
102
- let describeBlockName;
103
- let describeBlock;
104
- if (args.length === 3) {
105
- ;
106
- [scenarioName, describeBlockName, describeBlock] = args;
107
- } else if (args.length === 2) {
108
- scenarioName = DEFAULT_SCENARIO;
109
- [describeBlockName, describeBlock] = args;
110
- } else {
111
- throw new Error("describeScenario() requires 2 or 3 arguments");
112
- }
113
- return describeFunc(describeBlockName, () => {
114
- let scenarioData;
115
- (0, import_vitest.beforeAll)(async (ctx) => {
116
- const testPath = ctx.file.filepath;
117
- const { scenario } = await loadScenarios(testPath, scenarioName);
118
- scenarioData = await seedScenario(scenario);
119
- });
120
- (0, import_vitest.afterAll)(async () => {
121
- await teardown();
122
- });
123
- const getScenario = () => scenarioData;
124
- describeBlock(getScenario);
125
- });
126
- };
127
- }
128
- async function configureTeardown() {
129
- if (!wasDbImported()) {
130
- return;
131
- }
132
- const { getDMMF, getSchemaWithPath } = await import("@prisma/internals");
133
- const schemaPath = await (0, import_project_config.getSchemaPath)(cedarPaths.api.prismaConfig);
134
- const result = await getSchemaWithPath(schemaPath);
135
- const schema = await getDMMF({ datamodel: result.schemas });
136
- const schemaModels = schema.datamodel.models.map((m) => {
137
- return m.dbName || m.name;
138
- });
139
- if (import_node_fs.default.existsSync(TEARDOWN_CACHE_PATH)) {
140
- teardownOrder = JSON.parse(import_node_fs.default.readFileSync(TEARDOWN_CACHE_PATH).toString());
141
- }
142
- if (teardownOrder.length !== schemaModels.length) {
143
- teardownOrder = schemaModels;
144
- }
145
- originalTeardownOrder = deepCopy(teardownOrder);
146
- }
147
- (0, import_vitest.beforeAll)(async () => {
148
- await configureTeardown();
149
- });
150
- (0, import_vitest.afterAll)(() => {
151
- globalThis.__cedarjs_db_imported__ = false;
152
- });
153
- async function teardown() {
154
- if (!wasDbImported()) {
155
- return;
156
- }
157
- const quoteStyle2 = await getQuoteStyle();
158
- const projectDb = await getProjectDb();
159
- for (const modelName of teardownOrder) {
160
- try {
161
- const query = `DELETE FROM ${quoteStyle2}${modelName}${quoteStyle2}`;
162
- await projectDb.$executeRawUnsafe(query);
163
- } catch (e) {
164
- console.error("teardown error\n", e);
165
- const match = isErrorWithMessage(e) && e.message.match(/Code: `(\d+)`/);
166
- if (match && FOREIGN_KEY_ERRORS.includes(parseInt(match[1]))) {
167
- const index = teardownOrder.indexOf(modelName);
168
- teardownOrder[index] = null;
169
- teardownOrder.push(modelName);
170
- } else {
171
- throw e;
172
- }
173
- }
174
- }
175
- teardownOrder = teardownOrder.filter((val) => val);
176
- if (!isIdenticalArray(teardownOrder, originalTeardownOrder)) {
177
- originalTeardownOrder = deepCopy(teardownOrder);
178
- import_node_fs.default.writeFileSync(TEARDOWN_CACHE_PATH, JSON.stringify(teardownOrder));
179
- }
180
- }
181
- const seedScenario = async (scenario) => {
182
- if (scenario) {
183
- const scenarios = {};
184
- const projectDb = await getProjectDb();
185
- for (const [model, namedFixtures] of Object.entries(scenario)) {
186
- scenarios[model] = {};
187
- for (const [name, createArgs] of Object.entries(namedFixtures)) {
188
- if (typeof createArgs === "function") {
189
- scenarios[model][name] = await projectDb[model].create(
190
- createArgs(scenarios)
191
- );
192
- } else {
193
- scenarios[model][name] = await projectDb[model].create(createArgs);
194
- }
195
- }
196
- }
197
- return scenarios;
198
- } else {
199
- return {};
200
- }
201
- };
202
- async function loadScenarios(testPath, scenarioName) {
203
- const testFileDir = import_node_path.default.parse(testPath);
204
- const testFileNameParts = testFileDir.name.split(".");
205
- const testFilePath = `${testFileDir.dir}/${testFileNameParts.slice(0, testFileNameParts.length - 1).join(".")}.scenarios`;
206
- let allScenarios;
207
- let scenario;
208
- try {
209
- allScenarios = await import(testFilePath);
210
- } catch (e) {
211
- if (isErrorWithCode(e)) {
212
- if (e instanceof Error) {
213
- throw e;
214
- } else {
215
- console.error("unexpected error type", e);
216
- throw e;
217
- }
218
- }
219
- }
220
- if (allScenarios) {
221
- if (allScenarios[scenarioName]) {
222
- scenario = allScenarios[scenarioName];
223
- } else {
224
- throw new Error(
225
- `UndefinedScenario: There is no scenario named "${scenarioName}" in ${testFilePath}.{js,ts}`
226
- );
227
- }
228
- }
229
- return { scenario };
230
- }
231
- const wasDbImported = () => {
232
- return Boolean(globalThis.__cedarjs_db_imported__);
233
- };
234
- let quoteStyle;
235
- async function getQuoteStyle() {
236
- const { getConfig: getPrismaConfig, getSchemaWithPath } = await import("@prisma/internals");
237
- const schemaPath = await (0, import_project_config.getSchemaPath)(cedarPaths.api.prismaConfig);
238
- const result = await getSchemaWithPath(schemaPath);
239
- if (!quoteStyle) {
240
- const config = await getPrismaConfig({
241
- datamodel: result.schemas
242
- });
243
- switch (config.datasources?.[0]?.provider) {
244
- case "mysql":
245
- quoteStyle = "`";
246
- break;
247
- default:
248
- quoteStyle = '"';
249
- }
250
- }
251
- return quoteStyle;
252
- }
253
- async function getProjectDb() {
254
- const libDb = await import(`${cedarPaths.api.lib}/db`);
255
- return libDb.db;
256
- }
257
- function isIdenticalArray(a, b) {
258
- return JSON.stringify(a) === JSON.stringify(b);
259
- }
260
- function deepCopy(obj) {
261
- return JSON.parse(JSON.stringify(obj));
262
- }
263
- function isErrorWithMessage(e) {
264
- return !!e && typeof e === "object" && "message" in e && typeof e.message === "string";
265
- }
266
- function isErrorWithCode(e) {
267
- return !!e && typeof e === "object" && "code" in e && typeof e.code === "string";
268
- }
269
- globalThis.scenario = buildScenario(import_vitest.it);
270
- globalThis.scenario.only = buildScenario(import_vitest.it.only);
271
- globalThis.describeScenario = buildDescribeScenario(import_vitest.describe);
272
- globalThis.describeScenario.only = buildDescribeScenario(import_vitest.describe.only);
@@ -1,50 +0,0 @@
1
- type AsymmetricMatcher = {
2
- $$typeof: symbol;
3
- };
4
- type ExpectedValue = any[] | any | AsymmetricMatcher;
5
- type ExpectedKey = string | RegExp;
6
- declare global {
7
- namespace jest {
8
- interface Matchers<R> {
9
- /**
10
- *
11
- * Use this helper to simplify testing your InMemoryCache client.
12
- *
13
- * The expected value you provide will be serialized and deseriliazed for you.
14
- *
15
- * NOTE: Does not support partialMatch - use cacheClient.contents or test with a key!
16
- * @param expectedValue The value that is cached, must be serializable
17
- */
18
- toHaveCached(expectedValue: unknown): R;
19
- /**
20
- *
21
- * Use this helper to simplify testing your InMemoryCache client.
22
- *
23
- *
24
- * @param cacheKey They key that your value is cached under
25
- * @param expectedValue The expected value. Can be a jest asymmetric matcher (using `partialMatch`)
26
- */
27
- toHaveCached(cacheKey: ExpectedKey, expectedValue: ExpectedValue): R;
28
- }
29
- }
30
- }
31
- /**
32
- * This is just syntactic sugar, to help with testing cache contents.
33
- *
34
- * If you pass an array, it will check arrays for a partial match of the object.
35
- *
36
- * If you pass an object, it will check for a partial match of the object.
37
- *
38
- * Useful when you don't want to compare dates/auto-generated ids etc.
39
- *
40
- * @example
41
- * expect(testCacheClient.contents).toContainEqual(partialMatch({ title: 'Only look for this title'}))
42
- *
43
- * @example
44
- * expect(testCacheClient.contents).toContainEqual(partialMatch([{id: 1}, {id: 2}]))
45
- *
46
- * @param value Object or Array of object to match
47
- */
48
- export declare const partialMatch: (value: Record<any, any> | Record<any, any>[]) => any;
49
- export {};
50
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cache/index.ts"],"names":[],"mappings":"AAEA,KAAK,iBAAiB,GAAG;IACvB,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,KAAK,aAAa,GAAG,GAAG,EAAE,GAAG,GAAG,GAAG,iBAAiB,CAAA;AACpD,KAAK,WAAW,GAAG,MAAM,GAAG,MAAM,CAAA;AAwHlC,OAAO,CAAC,MAAM,CAAC;IAEb,UAAU,IAAI,CAAC;QACb,UAAU,QAAQ,CAAC,CAAC;YAClB;;;;;;;;eAQG;YACH,YAAY,CAAC,aAAa,EAAE,OAAO,GAAG,CAAC,CAAA;YAEvC;;;;;;;eAOG;YACH,YAAY,CAAC,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,GAAG,CAAC,CAAA;SACrE;KACF;CACF;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,QAIxE,CAAA"}
@@ -1,104 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var cache_exports = {};
20
- __export(cache_exports, {
21
- partialMatch: () => partialMatch
22
- });
23
- module.exports = __toCommonJS(cache_exports);
24
- expect.extend({
25
- toHaveCached(cacheClient, keyOrExpectedValue, expectedValue) {
26
- let value;
27
- let regexKey;
28
- let stringKey;
29
- if (_isKVPair(keyOrExpectedValue, expectedValue)) {
30
- if (keyOrExpectedValue instanceof RegExp) {
31
- regexKey = keyOrExpectedValue;
32
- } else {
33
- stringKey = keyOrExpectedValue;
34
- }
35
- value = expectedValue;
36
- } else {
37
- value = keyOrExpectedValue;
38
- }
39
- let foundKVPair;
40
- let found = false;
41
- if (stringKey) {
42
- return _checkValueForKey(cacheClient, stringKey, value);
43
- } else {
44
- for (const [cachedKey, cachedValue] of Object.entries(
45
- cacheClient.storage
46
- )) {
47
- if (found) {
48
- break;
49
- }
50
- if (regexKey?.test(cachedKey)) {
51
- found = true;
52
- foundKVPair = { key: cachedKey, value: cachedValue.value };
53
- } else {
54
- found = cachedValue.value === JSON.stringify(value);
55
- }
56
- }
57
- }
58
- if (foundKVPair) {
59
- return _checkValueForKey(cacheClient, foundKVPair.key, value);
60
- }
61
- if (found) {
62
- return {
63
- pass: true,
64
- message: () => "Found cached value"
65
- };
66
- } else {
67
- return {
68
- pass: false,
69
- message: () => `Expected Cached Value: ${this.utils.printExpected(
70
- JSON.stringify(value)
71
- )}
72
- Cache Contents: ${this.utils.printReceived(cacheClient.storage)}`
73
- };
74
- }
75
- }
76
- });
77
- const _isKVPair = (keyOrCachedValue, cachedValue) => {
78
- return !!cachedValue && !!keyOrCachedValue;
79
- };
80
- const _checkValueForKey = (cacheClient, cacheKey, expectedValue) => {
81
- try {
82
- const cachedStringValue = cacheClient.storage[cacheKey]?.value;
83
- const expectedValueOrMatcher = expectedValue?.$$typeof === Symbol.for("jest.asymmetricMatcher") ? expectedValue : JSON.parse(JSON.stringify(expectedValue));
84
- expect(
85
- cachedStringValue ? JSON.parse(cachedStringValue) : void 0
86
- ).toEqual(expectedValueOrMatcher);
87
- return {
88
- pass: true,
89
- message: () => `Found cached value with ${cacheKey}`
90
- };
91
- } catch (e) {
92
- return {
93
- pass: false,
94
- message: () => e.message
95
- };
96
- }
97
- };
98
- const partialMatch = (value) => {
99
- return Array.isArray(value) ? expect.arrayContaining(value.map((v) => expect.objectContaining(v))) : expect.objectContaining(value);
100
- };
101
- // Annotate the CommonJS export names for ESM import in node:
102
- 0 && (module.exports = {
103
- partialMatch
104
- });
@@ -1,11 +0,0 @@
1
- import type { EnvironmentContext, JestEnvironmentConfig } from '@jest/environment';
2
- import { TestEnvironment } from 'jest-environment-node';
3
- declare class RedwoodApiJestEnvironment extends TestEnvironment {
4
- private testPath;
5
- constructor(config: JestEnvironmentConfig, context: EnvironmentContext);
6
- setup(): Promise<void>;
7
- teardown(): Promise<void>;
8
- getVmContext(): import("vm").Context | null;
9
- }
10
- export default RedwoodApiJestEnvironment;
11
- //# sourceMappingURL=RedwoodApiJestEnv.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RedwoodApiJestEnv.d.ts","sourceRoot":"","sources":["../../../../../src/config/jest/api/RedwoodApiJestEnv.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEvD,cAAM,yBAA0B,SAAQ,eAAe;IACrD,OAAO,CAAC,QAAQ,CAAQ;gBAEZ,MAAM,EAAE,qBAAqB,EAAE,OAAO,EAAE,kBAAkB;IAKhE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAMtB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAI/B,YAAY;CAUb;AAED,eAAe,yBAAyB,CAAA"}
@@ -1,48 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var RedwoodApiJestEnv_exports = {};
20
- __export(RedwoodApiJestEnv_exports, {
21
- default: () => RedwoodApiJestEnv_default
22
- });
23
- module.exports = __toCommonJS(RedwoodApiJestEnv_exports);
24
- var import_jest_environment_node = require("jest-environment-node");
25
- class RedwoodApiJestEnvironment extends import_jest_environment_node.TestEnvironment {
26
- testPath;
27
- constructor(config, context) {
28
- super(config, context);
29
- this.testPath = context.testPath;
30
- }
31
- async setup() {
32
- await super.setup();
33
- this.global.testPath = this.testPath;
34
- }
35
- async teardown() {
36
- await super.teardown();
37
- }
38
- getVmContext() {
39
- return super.getVmContext();
40
- }
41
- // async handleTestEvent(event, state) {
42
- // if (event.name === 'test_start') {
43
- // // Link to event docs:
44
- // // https://github.com/facebook/jest/blob/master/packages/jest-types/src/Circus.ts
45
- // }
46
- // }
47
- }
48
- var RedwoodApiJestEnv_default = RedwoodApiJestEnvironment;
@@ -1,5 +0,0 @@
1
- import { getApiSideDefaultBabelConfig } from '@cedarjs/babel-config';
2
- type ConfigType = Omit<ReturnType<typeof getApiSideDefaultBabelConfig>, 'babelrc'>;
3
- declare const config: ConfigType;
4
- export default config;
5
- //# sourceMappingURL=apiBabelConfig.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"apiBabelConfig.d.ts","sourceRoot":"","sources":["../../../../../src/config/jest/api/apiBabelConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,EAG7B,MAAM,uBAAuB,CAAA;AAO9B,KAAK,UAAU,GAAG,IAAI,CACpB,UAAU,CAAC,OAAO,4BAA4B,CAAC,EAC/C,SAAS,CACV,CAAA;AAED,QAAA,MAAM,MAAM,EAAE,UAMb,CAAA;AAED,eAAe,MAAM,CAAA"}
@@ -1,34 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var apiBabelConfig_exports = {};
20
- __export(apiBabelConfig_exports, {
21
- default: () => apiBabelConfig_default
22
- });
23
- module.exports = __toCommonJS(apiBabelConfig_exports);
24
- var import_babel_config = require("@cedarjs/babel-config");
25
- const { babelrc: _b, ...defaultBabelConfig } = (0, import_babel_config.getApiSideDefaultBabelConfig)();
26
- const config = {
27
- ...defaultBabelConfig,
28
- plugins: (0, import_babel_config.getApiSideBabelPlugins)(),
29
- presets: (0, import_babel_config.getApiSideBabelPresets)({
30
- presetEnv: true
31
- // jest needs code transpiled
32
- })
33
- };
34
- var apiBabelConfig_default = config;
@@ -1,3 +0,0 @@
1
- import 'dotenv-defaults/config';
2
- export default function (): Promise<void>;
3
- //# sourceMappingURL=globalSetup.d.ts.map
@@ -1 +0,0 @@
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,63 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var globalSetup_exports = {};
30
- __export(globalSetup_exports, {
31
- default: () => globalSetup_default
32
- });
33
- module.exports = __toCommonJS(globalSetup_exports);
34
- var import_internals = __toESM(require("@prisma/internals"), 1);
35
- var import_config = require("dotenv-defaults/config");
36
- var import_execa = __toESM(require("execa"), 1);
37
- var import_project_config = require("@cedarjs/project-config");
38
- var import_directUrlHelpers = require("../../../api/directUrlHelpers.js");
39
- const { getSchemaWithPath } = import_internals.default;
40
- const rwjsPaths = (0, import_project_config.getPaths)();
41
- async function globalSetup_default() {
42
- if (process.env.SKIP_DB_PUSH === "1") {
43
- return;
44
- }
45
- const defaultDb = (0, import_directUrlHelpers.getDefaultDb)(rwjsPaths.base);
46
- process.env.DATABASE_URL = process.env.TEST_DATABASE_URL || defaultDb;
47
- const schemaPath = await (0, import_project_config.getSchemaPath)(rwjsPaths.api.prismaConfig);
48
- const result = await getSchemaWithPath(schemaPath);
49
- const prismaSchema = result.schemas.map(([, content]) => content).join("\n");
50
- const directUrlEnvVar = (0, import_directUrlHelpers.checkAndReplaceDirectUrl)(prismaSchema, defaultDb);
51
- const command = process.env.TEST_DATABASE_STRATEGY === "reset" ? ["prisma", "migrate", "reset", "--force", "--skip-seed"] : ["prisma", "db", "push", "--force-reset", "--accept-data-loss"];
52
- const env = {
53
- DATABASE_URL: process.env.DATABASE_URL
54
- };
55
- if (directUrlEnvVar) {
56
- env[directUrlEnvVar] = process.env[directUrlEnvVar];
57
- }
58
- import_execa.default.sync("yarn", ["cedar", ...command], {
59
- cwd: rwjsPaths.api.base,
60
- stdio: "inherit",
61
- env
62
- });
63
- }
@@ -1,3 +0,0 @@
1
- import * as jestPreset from './jest-preset.js';
2
- export = jestPreset;
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/config/jest/api/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAA;AAK9C,SAAS,UAAU,CAAA"}