@cedarjs/testing 5.0.0-canary.2362 → 5.0.0-canary.2373
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.
|
@@ -33,20 +33,20 @@ __export(jest_preset_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(jest_preset_exports);
|
|
34
34
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
35
35
|
var import_project_config = require("@cedarjs/project-config");
|
|
36
|
-
const
|
|
37
|
-
const NODE_MODULES_PATH = import_node_path.default.join(
|
|
36
|
+
const cedarPaths = (0, import_project_config.getPaths)();
|
|
37
|
+
const NODE_MODULES_PATH = import_node_path.default.join(cedarPaths.base, "node_modules");
|
|
38
38
|
const config = {
|
|
39
39
|
// To make sure other config option which depends on rootDir always
|
|
40
40
|
// use correct path, for example, coverageDirectory
|
|
41
|
-
rootDir:
|
|
42
|
-
roots: [import_node_path.default.join(
|
|
41
|
+
rootDir: cedarPaths.base,
|
|
42
|
+
roots: [import_node_path.default.join(cedarPaths.web.src)],
|
|
43
43
|
testEnvironment: import_node_path.default.join(__dirname, "./RedwoodWebJestEnv.js"),
|
|
44
44
|
displayName: {
|
|
45
45
|
color: "blueBright",
|
|
46
46
|
name: "web"
|
|
47
47
|
},
|
|
48
48
|
globals: {
|
|
49
|
-
__RWJS_TESTROOT_DIR: import_node_path.default.join(
|
|
49
|
+
__RWJS_TESTROOT_DIR: import_node_path.default.join(cedarPaths.web.src),
|
|
50
50
|
// used in jest setup to load mocks
|
|
51
51
|
RWJS_ENV: {
|
|
52
52
|
RWJS_API_URL: "",
|
|
@@ -54,7 +54,7 @@ const config = {
|
|
|
54
54
|
__REDWOOD__APP_TITLE: "Redwood App"
|
|
55
55
|
},
|
|
56
56
|
RWJS_DEBUG_ENV: {
|
|
57
|
-
RWJS_SRC_ROOT:
|
|
57
|
+
RWJS_SRC_ROOT: cedarPaths.web.src
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
60
|
collectCoverageFrom: [
|
|
@@ -62,7 +62,7 @@ const config = {
|
|
|
62
62
|
"!**/node_modules/**",
|
|
63
63
|
"!**/dist/**"
|
|
64
64
|
],
|
|
65
|
-
coverageDirectory: import_node_path.default.join(
|
|
65
|
+
coverageDirectory: import_node_path.default.join(cedarPaths.base, "coverage"),
|
|
66
66
|
watchPlugins: [
|
|
67
67
|
"jest-watch-typeahead/filename",
|
|
68
68
|
"jest-watch-typeahead/testname"
|
|
@@ -94,8 +94,8 @@ const config = {
|
|
|
94
94
|
// @NOTE: Import @cedarjs/testing in web tests, and it automatically remaps to the web side only
|
|
95
95
|
// This is to prevent web stuff leaking into api, and vice versa
|
|
96
96
|
"^@cedarjs/testing$": import_node_path.default.join(NODE_MODULES_PATH, "@cedarjs/testing/web"),
|
|
97
|
-
"~
|
|
98
|
-
"~
|
|
97
|
+
"~__CEDAR__USER_ROUTES_FOR_MOCK": cedarPaths.web.routes,
|
|
98
|
+
"~__CEDAR__USER_AUTH_FOR_MOCK": import_node_path.default.join(cedarPaths.web.src, "auth"),
|
|
99
99
|
/**
|
|
100
100
|
* Mock out files that aren't particularly useful in tests. See fileMock.js for more info.
|
|
101
101
|
*/
|
|
@@ -33,20 +33,20 @@ __export(jest_preset_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(jest_preset_exports);
|
|
34
34
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
35
35
|
var import_project_config = require("@cedarjs/project-config");
|
|
36
|
-
const
|
|
37
|
-
const NODE_MODULES_PATH = import_node_path.default.join(
|
|
36
|
+
const cedarPaths = (0, import_project_config.getPaths)();
|
|
37
|
+
const NODE_MODULES_PATH = import_node_path.default.join(cedarPaths.base, "node_modules");
|
|
38
38
|
const config = {
|
|
39
39
|
// To make sure other config option which depends on rootDir always
|
|
40
40
|
// use correct path, for example, coverageDirectory
|
|
41
|
-
rootDir:
|
|
42
|
-
roots: [import_node_path.default.join(
|
|
41
|
+
rootDir: cedarPaths.base,
|
|
42
|
+
roots: [import_node_path.default.join(cedarPaths.web.src)],
|
|
43
43
|
testEnvironment: import_node_path.default.join(__dirname, "./RedwoodWebJestEnv.js"),
|
|
44
44
|
displayName: {
|
|
45
45
|
color: "blueBright",
|
|
46
46
|
name: "web"
|
|
47
47
|
},
|
|
48
48
|
globals: {
|
|
49
|
-
__RWJS_TESTROOT_DIR: import_node_path.default.join(
|
|
49
|
+
__RWJS_TESTROOT_DIR: import_node_path.default.join(cedarPaths.web.src),
|
|
50
50
|
// used in jest setup to load mocks
|
|
51
51
|
RWJS_ENV: {
|
|
52
52
|
RWJS_API_URL: "",
|
|
@@ -54,7 +54,7 @@ const config = {
|
|
|
54
54
|
__REDWOOD__APP_TITLE: "Redwood App"
|
|
55
55
|
},
|
|
56
56
|
RWJS_DEBUG_ENV: {
|
|
57
|
-
RWJS_SRC_ROOT:
|
|
57
|
+
RWJS_SRC_ROOT: cedarPaths.web.src
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
60
|
collectCoverageFrom: [
|
|
@@ -62,7 +62,7 @@ const config = {
|
|
|
62
62
|
"!**/node_modules/**",
|
|
63
63
|
"!**/dist/**"
|
|
64
64
|
],
|
|
65
|
-
coverageDirectory: import_node_path.default.join(
|
|
65
|
+
coverageDirectory: import_node_path.default.join(cedarPaths.base, "coverage"),
|
|
66
66
|
watchPlugins: [
|
|
67
67
|
"jest-watch-typeahead/filename",
|
|
68
68
|
"jest-watch-typeahead/testname"
|
|
@@ -94,8 +94,8 @@ const config = {
|
|
|
94
94
|
// @NOTE: Import @cedarjs/testing in web tests, and it automatically remaps to the web side only
|
|
95
95
|
// This is to prevent web stuff leaking into api, and vice versa
|
|
96
96
|
"^@cedarjs/testing$": import_node_path.default.join(NODE_MODULES_PATH, "@cedarjs/testing/web"),
|
|
97
|
-
"~
|
|
98
|
-
"~
|
|
97
|
+
"~__CEDAR__USER_ROUTES_FOR_MOCK": cedarPaths.web.routes,
|
|
98
|
+
"~__CEDAR__USER_AUTH_FOR_MOCK": import_node_path.default.join(cedarPaths.web.src, "auth"),
|
|
99
99
|
/**
|
|
100
100
|
* Mock out files that aren't particularly useful in tests. See fileMock.js for more info.
|
|
101
101
|
*/
|
|
@@ -40,10 +40,10 @@ var import_mockAuth = require("./mockAuth.js");
|
|
|
40
40
|
var import_MockParamsProvider = require("./MockParamsProvider.js");
|
|
41
41
|
let UserRoutes;
|
|
42
42
|
try {
|
|
43
|
-
const userRoutesModule = require("~
|
|
43
|
+
const userRoutesModule = require("~__CEDAR__USER_ROUTES_FOR_MOCK");
|
|
44
44
|
UserRoutes = userRoutesModule.default;
|
|
45
45
|
} catch (error) {
|
|
46
|
-
if (!isModuleNotFoundError(error, "~
|
|
46
|
+
if (!isModuleNotFoundError(error, "~__CEDAR__USER_ROUTES_FOR_MOCK")) {
|
|
47
47
|
console.warn(error);
|
|
48
48
|
}
|
|
49
49
|
UserRoutes = () => /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null);
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { getPaths } from "@cedarjs/project-config";
|
|
3
|
-
const
|
|
4
|
-
const NODE_MODULES_PATH = path.join(
|
|
3
|
+
const cedarPaths = getPaths();
|
|
4
|
+
const NODE_MODULES_PATH = path.join(cedarPaths.base, "node_modules");
|
|
5
5
|
const config = {
|
|
6
6
|
// To make sure other config option which depends on rootDir always
|
|
7
7
|
// use correct path, for example, coverageDirectory
|
|
8
|
-
rootDir:
|
|
9
|
-
roots: [path.join(
|
|
8
|
+
rootDir: cedarPaths.base,
|
|
9
|
+
roots: [path.join(cedarPaths.web.src)],
|
|
10
10
|
testEnvironment: path.join(__dirname, "./RedwoodWebJestEnv.js"),
|
|
11
11
|
displayName: {
|
|
12
12
|
color: "blueBright",
|
|
13
13
|
name: "web"
|
|
14
14
|
},
|
|
15
15
|
globals: {
|
|
16
|
-
__RWJS_TESTROOT_DIR: path.join(
|
|
16
|
+
__RWJS_TESTROOT_DIR: path.join(cedarPaths.web.src),
|
|
17
17
|
// used in jest setup to load mocks
|
|
18
18
|
RWJS_ENV: {
|
|
19
19
|
RWJS_API_URL: "",
|
|
@@ -21,7 +21,7 @@ const config = {
|
|
|
21
21
|
__REDWOOD__APP_TITLE: "Redwood App"
|
|
22
22
|
},
|
|
23
23
|
RWJS_DEBUG_ENV: {
|
|
24
|
-
RWJS_SRC_ROOT:
|
|
24
|
+
RWJS_SRC_ROOT: cedarPaths.web.src
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
collectCoverageFrom: [
|
|
@@ -29,7 +29,7 @@ const config = {
|
|
|
29
29
|
"!**/node_modules/**",
|
|
30
30
|
"!**/dist/**"
|
|
31
31
|
],
|
|
32
|
-
coverageDirectory: path.join(
|
|
32
|
+
coverageDirectory: path.join(cedarPaths.base, "coverage"),
|
|
33
33
|
watchPlugins: [
|
|
34
34
|
"jest-watch-typeahead/filename",
|
|
35
35
|
"jest-watch-typeahead/testname"
|
|
@@ -61,8 +61,8 @@ const config = {
|
|
|
61
61
|
// @NOTE: Import @cedarjs/testing in web tests, and it automatically remaps to the web side only
|
|
62
62
|
// This is to prevent web stuff leaking into api, and vice versa
|
|
63
63
|
"^@cedarjs/testing$": path.join(NODE_MODULES_PATH, "@cedarjs/testing/web"),
|
|
64
|
-
"~
|
|
65
|
-
"~
|
|
64
|
+
"~__CEDAR__USER_ROUTES_FOR_MOCK": cedarPaths.web.routes,
|
|
65
|
+
"~__CEDAR__USER_AUTH_FOR_MOCK": path.join(cedarPaths.web.src, "auth"),
|
|
66
66
|
/**
|
|
67
67
|
* Mock out files that aren't particularly useful in tests. See fileMock.js for more info.
|
|
68
68
|
*/
|
|
@@ -7,10 +7,10 @@ import { useAuth } from "./mockAuth.js";
|
|
|
7
7
|
import { MockParamsProvider } from "./MockParamsProvider.js";
|
|
8
8
|
let UserRoutes;
|
|
9
9
|
try {
|
|
10
|
-
const userRoutesModule = require("~
|
|
10
|
+
const userRoutesModule = require("~__CEDAR__USER_ROUTES_FOR_MOCK");
|
|
11
11
|
UserRoutes = userRoutesModule.default;
|
|
12
12
|
} catch (error) {
|
|
13
|
-
if (!isModuleNotFoundError(error, "~
|
|
13
|
+
if (!isModuleNotFoundError(error, "~__CEDAR__USER_ROUTES_FOR_MOCK")) {
|
|
14
14
|
console.warn(error);
|
|
15
15
|
}
|
|
16
16
|
UserRoutes = () => /* @__PURE__ */ React.createElement(React.Fragment, null);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/testing",
|
|
3
|
-
"version": "5.0.0-canary.
|
|
3
|
+
"version": "5.0.0-canary.2373",
|
|
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": "5.0.0-canary.
|
|
123
|
-
"@cedarjs/babel-config": "5.0.0-canary.
|
|
124
|
-
"@cedarjs/context": "5.0.0-canary.
|
|
125
|
-
"@cedarjs/graphql-server": "5.0.0-canary.
|
|
126
|
-
"@cedarjs/project-config": "5.0.0-canary.
|
|
127
|
-
"@cedarjs/router": "5.0.0-canary.
|
|
128
|
-
"@cedarjs/web": "5.0.0-canary.
|
|
122
|
+
"@cedarjs/auth": "5.0.0-canary.2373",
|
|
123
|
+
"@cedarjs/babel-config": "5.0.0-canary.2373",
|
|
124
|
+
"@cedarjs/context": "5.0.0-canary.2373",
|
|
125
|
+
"@cedarjs/graphql-server": "5.0.0-canary.2373",
|
|
126
|
+
"@cedarjs/project-config": "5.0.0-canary.2373",
|
|
127
|
+
"@cedarjs/router": "5.0.0-canary.2373",
|
|
128
|
+
"@cedarjs/web": "5.0.0-canary.2373",
|
|
129
129
|
"@testing-library/jest-dom": "6.9.1",
|
|
130
130
|
"@testing-library/react": "14.3.1",
|
|
131
131
|
"@testing-library/user-event": "14.6.1",
|
|
@@ -145,10 +145,10 @@
|
|
|
145
145
|
"whatwg-fetch": "3.6.20"
|
|
146
146
|
},
|
|
147
147
|
"devDependencies": {
|
|
148
|
-
"@cedarjs/framework-tools": "5.0.0-canary.
|
|
148
|
+
"@cedarjs/framework-tools": "5.0.0-canary.2373",
|
|
149
149
|
"concurrently": "9.2.1",
|
|
150
150
|
"jsdom": "27.4.0",
|
|
151
|
-
"publint": "0.3.
|
|
151
|
+
"publint": "0.3.21",
|
|
152
152
|
"tsx": "4.21.0",
|
|
153
153
|
"typescript": "5.9.3",
|
|
154
154
|
"vitest": "3.2.4"
|