@cedarjs/testing 7.0.0-canary.2983 → 7.0.0-canary.2985
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/dist/cjs/web/MockRouter.d.ts.map +1 -1
- package/dist/cjs/web/mockRequests.js +2 -2
- package/dist/web/MockRouter.d.ts.map +1 -1
- package/package.json +12 -53
- package/config/jest/api/RedwoodApiJestEnv.d.ts +0 -11
- package/config/jest/api/RedwoodApiJestEnv.d.ts.map +0 -1
- package/config/jest/api/RedwoodApiJestEnv.js +0 -48
- package/config/jest/api/apiBabelConfig.d.ts +0 -5
- package/config/jest/api/apiBabelConfig.d.ts.map +0 -1
- package/config/jest/api/apiBabelConfig.js +0 -34
- package/config/jest/api/globalSetup.d.ts +0 -3
- package/config/jest/api/globalSetup.d.ts.map +0 -1
- package/config/jest/api/globalSetup.js +0 -63
- package/config/jest/api/index.d.ts +0 -3
- package/config/jest/api/index.d.ts.map +0 -1
- package/config/jest/api/index.js +0 -25
- package/config/jest/api/jest-preset.d.ts +0 -4
- package/config/jest/api/jest-preset.d.ts.map +0 -1
- package/config/jest/api/jest-preset.js +0 -135
- package/config/jest/api/jest.setup.d.ts +0 -2
- package/config/jest/api/jest.setup.d.ts.map +0 -1
- package/config/jest/api/jest.setup.js +0 -267
- package/config/jest/api/package.json +0 -8
- package/config/jest/babelPlugins/babel-plugin-redwood-cell.d.ts +0 -11
- package/config/jest/babelPlugins/babel-plugin-redwood-cell.d.ts.map +0 -1
- package/config/jest/babelPlugins/babel-plugin-redwood-cell.js +0 -122
- package/config/jest/jest-serial-runner.d.ts +0 -8
- package/config/jest/jest-serial-runner.d.ts.map +0 -1
- package/config/jest/jest-serial-runner.js +0 -37
- package/config/jest/web/RedwoodWebJestEnv.d.ts +0 -6
- package/config/jest/web/RedwoodWebJestEnv.d.ts.map +0 -1
- package/config/jest/web/RedwoodWebJestEnv.js +0 -43
- package/config/jest/web/index.d.ts +0 -3
- package/config/jest/web/index.d.ts.map +0 -1
- package/config/jest/web/index.js +0 -25
- package/config/jest/web/jest-fixed-jsdom.d.js +0 -1
- package/config/jest/web/jest-preset.d.ts +0 -4
- package/config/jest/web/jest-preset.d.ts.map +0 -1
- package/config/jest/web/jest-preset.js +0 -224
- package/config/jest/web/jest.setup.d.ts +0 -7
- package/config/jest/web/jest.setup.d.ts.map +0 -1
- package/config/jest/web/jest.setup.js +0 -21
- package/config/jest/web/package.json +0 -8
- package/config/jest/web/resolver.d.ts +0 -4
- package/config/jest/web/resolver.d.ts.map +0 -1
- package/config/jest/web/resolver.js +0 -30
- package/config/jest/web/webBabelConfig.d.ts +0 -10
- package/config/jest/web/webBabelConfig.d.ts.map +0 -1
- package/config/jest/web/webBabelConfig.js +0 -48
- package/config/package.json +0 -1
- package/dist/cjs/config/jest/api/RedwoodApiJestEnv.d.ts +0 -11
- package/dist/cjs/config/jest/api/RedwoodApiJestEnv.d.ts.map +0 -1
- package/dist/cjs/config/jest/api/RedwoodApiJestEnv.js +0 -48
- package/dist/cjs/config/jest/api/apiBabelConfig.d.ts +0 -5
- package/dist/cjs/config/jest/api/apiBabelConfig.d.ts.map +0 -1
- package/dist/cjs/config/jest/api/apiBabelConfig.js +0 -34
- package/dist/cjs/config/jest/api/globalSetup.d.ts +0 -3
- package/dist/cjs/config/jest/api/globalSetup.d.ts.map +0 -1
- package/dist/cjs/config/jest/api/globalSetup.js +0 -63
- package/dist/cjs/config/jest/api/index.d.ts +0 -3
- package/dist/cjs/config/jest/api/index.d.ts.map +0 -1
- package/dist/cjs/config/jest/api/index.js +0 -25
- package/dist/cjs/config/jest/api/jest-preset.d.ts +0 -4
- package/dist/cjs/config/jest/api/jest-preset.d.ts.map +0 -1
- package/dist/cjs/config/jest/api/jest-preset.js +0 -135
- package/dist/cjs/config/jest/api/jest.setup.d.ts +0 -2
- package/dist/cjs/config/jest/api/jest.setup.d.ts.map +0 -1
- package/dist/cjs/config/jest/api/jest.setup.js +0 -267
- package/dist/cjs/config/jest/babelPlugins/babel-plugin-redwood-cell.d.ts +0 -11
- package/dist/cjs/config/jest/babelPlugins/babel-plugin-redwood-cell.d.ts.map +0 -1
- package/dist/cjs/config/jest/babelPlugins/babel-plugin-redwood-cell.js +0 -122
- package/dist/cjs/config/jest/jest-serial-runner.d.ts +0 -8
- package/dist/cjs/config/jest/jest-serial-runner.d.ts.map +0 -1
- package/dist/cjs/config/jest/jest-serial-runner.js +0 -37
- package/dist/cjs/config/jest/web/RedwoodWebJestEnv.d.ts +0 -6
- package/dist/cjs/config/jest/web/RedwoodWebJestEnv.d.ts.map +0 -1
- package/dist/cjs/config/jest/web/RedwoodWebJestEnv.js +0 -43
- package/dist/cjs/config/jest/web/index.d.ts +0 -3
- package/dist/cjs/config/jest/web/index.d.ts.map +0 -1
- package/dist/cjs/config/jest/web/index.js +0 -25
- package/dist/cjs/config/jest/web/jest-fixed-jsdom.d.js +0 -1
- package/dist/cjs/config/jest/web/jest-preset.d.ts +0 -4
- package/dist/cjs/config/jest/web/jest-preset.d.ts.map +0 -1
- package/dist/cjs/config/jest/web/jest-preset.js +0 -224
- package/dist/cjs/config/jest/web/jest.setup.d.ts +0 -7
- package/dist/cjs/config/jest/web/jest.setup.d.ts.map +0 -1
- package/dist/cjs/config/jest/web/jest.setup.js +0 -21
- package/dist/cjs/config/jest/web/resolver.d.ts +0 -4
- package/dist/cjs/config/jest/web/resolver.d.ts.map +0 -1
- package/dist/cjs/config/jest/web/resolver.js +0 -30
- package/dist/cjs/config/jest/web/webBabelConfig.d.ts +0 -10
- package/dist/cjs/config/jest/web/webBabelConfig.d.ts.map +0 -1
- package/dist/cjs/config/jest/web/webBabelConfig.js +0 -48
- package/dist/cjs/web/fileMock.d.ts +0 -10
- package/dist/cjs/web/fileMock.d.ts.map +0 -1
- package/dist/cjs/web/fileMock.js +0 -24
- package/dist/config/jest/api/RedwoodApiJestEnv.d.ts +0 -11
- package/dist/config/jest/api/RedwoodApiJestEnv.d.ts.map +0 -1
- package/dist/config/jest/api/RedwoodApiJestEnv.js +0 -28
- package/dist/config/jest/api/apiBabelConfig.d.ts +0 -5
- package/dist/config/jest/api/apiBabelConfig.d.ts.map +0 -1
- package/dist/config/jest/api/apiBabelConfig.js +0 -18
- package/dist/config/jest/api/globalSetup.d.ts +0 -3
- package/dist/config/jest/api/globalSetup.d.ts.map +0 -1
- package/dist/config/jest/api/globalSetup.js +0 -36
- package/dist/config/jest/api/index.d.ts +0 -3
- package/dist/config/jest/api/index.d.ts.map +0 -1
- package/dist/config/jest/api/index.js +0 -15
- package/dist/config/jest/api/jest-preset.d.ts +0 -4
- package/dist/config/jest/api/jest-preset.d.ts.map +0 -1
- package/dist/config/jest/api/jest-preset.js +0 -105
- package/dist/config/jest/api/jest.setup.d.ts +0 -2
- package/dist/config/jest/api/jest.setup.d.ts.map +0 -1
- package/dist/config/jest/api/jest.setup.js +0 -244
- package/dist/config/jest/babelPlugins/babel-plugin-redwood-cell.d.ts +0 -11
- package/dist/config/jest/babelPlugins/babel-plugin-redwood-cell.d.ts.map +0 -1
- package/dist/config/jest/babelPlugins/babel-plugin-redwood-cell.js +0 -102
- package/dist/config/jest/jest-serial-runner.d.ts +0 -8
- package/dist/config/jest/jest-serial-runner.d.ts.map +0 -1
- package/dist/config/jest/jest-serial-runner.js +0 -27
- package/dist/config/jest/web/RedwoodWebJestEnv.d.ts +0 -6
- package/dist/config/jest/web/RedwoodWebJestEnv.d.ts.map +0 -1
- package/dist/config/jest/web/RedwoodWebJestEnv.js +0 -13
- package/dist/config/jest/web/index.d.ts +0 -3
- package/dist/config/jest/web/index.d.ts.map +0 -1
- package/dist/config/jest/web/index.js +0 -15
- package/dist/config/jest/web/jest-fixed-jsdom.d.js +0 -0
- package/dist/config/jest/web/jest-preset.d.ts +0 -4
- package/dist/config/jest/web/jest-preset.d.ts.map +0 -1
- package/dist/config/jest/web/jest-preset.js +0 -194
- package/dist/config/jest/web/jest.setup.d.ts +0 -7
- package/dist/config/jest/web/jest.setup.d.ts.map +0 -1
- package/dist/config/jest/web/jest.setup.js +0 -27
- package/dist/config/jest/web/resolver.d.ts +0 -4
- package/dist/config/jest/web/resolver.d.ts.map +0 -1
- package/dist/config/jest/web/resolver.js +0 -42
- package/dist/config/jest/web/webBabelConfig.d.ts +0 -10
- package/dist/config/jest/web/webBabelConfig.d.ts.map +0 -1
- package/dist/config/jest/web/webBabelConfig.js +0 -18
- package/dist/web/fileMock.d.ts +0 -10
- package/dist/web/fileMock.d.ts.map +0 -1
- package/dist/web/fileMock.js +0 -4
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import { getPaths } from "@cedarjs/project-config";
|
|
4
|
-
const cedarPaths = getPaths();
|
|
5
|
-
const RESOLVE_FROM = [cedarPaths.web.base, cedarPaths.base];
|
|
6
|
-
function resolvePackageDir(packageName, resolveFrom = RESOLVE_FROM) {
|
|
7
|
-
try {
|
|
8
|
-
return path.dirname(
|
|
9
|
-
require.resolve(`${packageName}/package.json`, { paths: resolveFrom })
|
|
10
|
-
);
|
|
11
|
-
} catch {
|
|
12
|
-
}
|
|
13
|
-
try {
|
|
14
|
-
let dir = path.dirname(require.resolve(packageName, { paths: resolveFrom }));
|
|
15
|
-
for (; ; ) {
|
|
16
|
-
const manifestPath = path.join(dir, "package.json");
|
|
17
|
-
if (fs.existsSync(manifestPath)) {
|
|
18
|
-
const manifest = JSON.parse(
|
|
19
|
-
fs.readFileSync(manifestPath, "utf-8")
|
|
20
|
-
);
|
|
21
|
-
if (manifest && typeof manifest === "object" && "name" in manifest && manifest.name === packageName) {
|
|
22
|
-
return dir;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
const parent = path.dirname(dir);
|
|
26
|
-
if (parent === dir) {
|
|
27
|
-
return void 0;
|
|
28
|
-
}
|
|
29
|
-
dir = parent;
|
|
30
|
-
}
|
|
31
|
-
} catch {
|
|
32
|
-
return void 0;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
function packagePath(packageName, relativePath = "", resolveFrom = RESOLVE_FROM) {
|
|
36
|
-
const packageDir = resolvePackageDir(packageName, resolveFrom);
|
|
37
|
-
return packageDir && path.join(packageDir, relativePath);
|
|
38
|
-
}
|
|
39
|
-
function resolveSubpath(specifier, resolveFrom = RESOLVE_FROM) {
|
|
40
|
-
try {
|
|
41
|
-
return require.resolve(specifier, { paths: resolveFrom });
|
|
42
|
-
} catch {
|
|
43
|
-
return void 0;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
const cedarWebDir = resolvePackageDir("@cedarjs/web");
|
|
47
|
-
const cedarWebResolveFrom = cedarWebDir ? [cedarWebDir, ...RESOLVE_FROM] : RESOLVE_FROM;
|
|
48
|
-
function definedEntries(mappings) {
|
|
49
|
-
return Object.fromEntries(
|
|
50
|
-
Object.entries(mappings).filter(
|
|
51
|
-
(entry) => entry[1] !== void 0
|
|
52
|
-
)
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
const config = {
|
|
56
|
-
// To make sure other config option which depends on rootDir always
|
|
57
|
-
// use correct path, for example, coverageDirectory
|
|
58
|
-
rootDir: cedarPaths.base,
|
|
59
|
-
roots: [path.join(cedarPaths.web.src)],
|
|
60
|
-
// Opting out of jsdom's browser-style export condition resolution (needed to
|
|
61
|
-
// resolve `msw/node`) is handled by the environment itself, via
|
|
62
|
-
// jest-fixed-jsdom
|
|
63
|
-
testEnvironment: path.join(__dirname, "./RedwoodWebJestEnv.js"),
|
|
64
|
-
displayName: {
|
|
65
|
-
color: "blueBright",
|
|
66
|
-
name: "web"
|
|
67
|
-
},
|
|
68
|
-
globals: {
|
|
69
|
-
__RWJS_TESTROOT_DIR: path.join(cedarPaths.web.src),
|
|
70
|
-
// used in jest setup to load mocks
|
|
71
|
-
RWJS_ENV: {
|
|
72
|
-
RWJS_API_URL: "",
|
|
73
|
-
RWJS_API_GRAPHQL_URL: "/",
|
|
74
|
-
__REDWOOD__APP_TITLE: "Redwood App"
|
|
75
|
-
},
|
|
76
|
-
RWJS_DEBUG_ENV: {
|
|
77
|
-
RWJS_SRC_ROOT: cedarPaths.web.src
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
collectCoverageFrom: [
|
|
81
|
-
"**/*.{js,jsx,ts,tsx}",
|
|
82
|
-
"!**/node_modules/**",
|
|
83
|
-
"!**/dist/**"
|
|
84
|
-
],
|
|
85
|
-
coverageDirectory: path.join(cedarPaths.base, "coverage"),
|
|
86
|
-
watchPlugins: [
|
|
87
|
-
"jest-watch-typeahead/filename",
|
|
88
|
-
"jest-watch-typeahead/testname"
|
|
89
|
-
],
|
|
90
|
-
setupFilesAfterEnv: [path.resolve(__dirname, "./jest.setup.js")],
|
|
91
|
-
moduleNameMapper: {
|
|
92
|
-
...definedEntries({
|
|
93
|
-
/**
|
|
94
|
-
* Make sure modules that require different versions of these
|
|
95
|
-
* dependencies end up using the same one.
|
|
96
|
-
*/
|
|
97
|
-
"^react$": resolveSubpath("react"),
|
|
98
|
-
"^react-dom$": resolveSubpath("react-dom"),
|
|
99
|
-
// Point straight at Apollo Client's CJS build. Resolving the subpath
|
|
100
|
-
// would go through its `exports` map and land on the ESM build (Node 22+
|
|
101
|
-
// picks the `module-sync` condition), which Jest can't parse.
|
|
102
|
-
// Resolved starting from `@cedarjs/web` because that's what depends on
|
|
103
|
-
// Apollo — a project doesn't declare it itself, so under pnpm it isn't
|
|
104
|
-
// reachable from the web side at all, and searching from there finds
|
|
105
|
-
// either nothing or some unrelated copy pulled in by another dependency
|
|
106
|
-
"^@apollo/client/react$": packagePath(
|
|
107
|
-
"@apollo/client",
|
|
108
|
-
"__cjs/react/index.cjs",
|
|
109
|
-
cedarWebResolveFrom
|
|
110
|
-
),
|
|
111
|
-
// We replace imports to "@cedarjs/router" with our own "mock" implementation.
|
|
112
|
-
"^@cedarjs/router$": resolveSubpath("@cedarjs/testing/web/MockRouter.js"),
|
|
113
|
-
"^@cedarjs/web$": resolveSubpath("@cedarjs/web"),
|
|
114
|
-
// This allows us to mock `createAuthentication` which is used by auth
|
|
115
|
-
// clients, which in turn lets us mock `useAuth` in tests
|
|
116
|
-
"^@cedarjs/auth$": resolveSubpath("@cedarjs/testing/auth"),
|
|
117
|
-
// @NOTE: Import @cedarjs/testing in web tests, and it automatically remaps to the web side only
|
|
118
|
-
// This is to prevent web stuff leaking into api, and vice versa
|
|
119
|
-
"^@cedarjs/testing$": resolveSubpath("@cedarjs/testing/web"),
|
|
120
|
-
/**
|
|
121
|
-
* Mock out files that aren't particularly useful in tests. See fileMock.js for more info.
|
|
122
|
-
*/
|
|
123
|
-
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|css)$": resolveSubpath("@cedarjs/testing/dist/cjs/web/fileMock.js")
|
|
124
|
-
}),
|
|
125
|
-
"~__CEDAR__USER_ROUTES_FOR_MOCK": cedarPaths.web.routes,
|
|
126
|
-
"~__CEDAR__USER_AUTH_FOR_MOCK": path.join(cedarPaths.web.src, "auth"),
|
|
127
|
-
// Support for importing files with extensions (like you'd do in ESM projects)
|
|
128
|
-
"^(\\.{1,2}/.*)\\.js$": "$1"
|
|
129
|
-
},
|
|
130
|
-
transform: {
|
|
131
|
-
// MSW's CommonJS build `require`s ESM-only packages (`rettime`,
|
|
132
|
-
// `@open-draft/deferred-promise` and `until-async`, which ships ESM in
|
|
133
|
-
// plain `.js` files). Node supports require(esm), but Jest's runtime
|
|
134
|
-
// doesn't, so compile any `.mjs` file that gets pulled in from
|
|
135
|
-
// node_modules (plus until-async) to CommonJS. This needs its own
|
|
136
|
-
// transform entry (with the config inlined) because the web babel config
|
|
137
|
-
// ignores node_modules
|
|
138
|
-
//
|
|
139
|
-
// The `@cedarjs/auth-*-web` packages are ESM-only too, and (like
|
|
140
|
-
// until-async) ship plain `.js` files rather than `.mjs` since their
|
|
141
|
-
// package.json already declares `"type": "module"`. A generated
|
|
142
|
-
// project's `web/src/auth.ts` imports one of these, so they need the
|
|
143
|
-
// same carve-out. `@cedarjs/forms` is ESM-only for the same reason, and
|
|
144
|
-
// gets pulled into virtually every generated project's web-side tests
|
|
145
|
-
// via `web/src/pages/**` scaffolds and dbAuth login/signup forms.
|
|
146
|
-
// `@cedarjs/web`, `@cedarjs/auth`, and `@cedarjs/router` are ESM-only
|
|
147
|
-
// too. `web` and `router` are imported directly by virtually every
|
|
148
|
-
// generated project's web-side test (`Routes.tsx`, page/component
|
|
149
|
-
// scaffolds), and `auth` gets pulled in transitively through `web`.
|
|
150
|
-
// Jest's own module loader re-applies this carve-out to every file it
|
|
151
|
-
// loads, including ones reached transitively through an
|
|
152
|
-
// already-transformed require() call, so all of them need to be listed
|
|
153
|
-
// even though only `web`/`router` are usually imported directly.
|
|
154
|
-
"[/\\\\]node_modules[/\\\\](?:.+\\.mjs|(?:until-async|@cedarjs[/\\\\](?:auth-[a-z-]+-web|forms|web|auth|router))[/\\\\].+\\.js)$": [
|
|
155
|
-
"babel-jest",
|
|
156
|
-
{
|
|
157
|
-
babelrc: false,
|
|
158
|
-
configFile: false,
|
|
159
|
-
presets: [
|
|
160
|
-
[require.resolve("@babel/preset-env"), { targets: { node: "20" } }]
|
|
161
|
-
]
|
|
162
|
-
}
|
|
163
|
-
],
|
|
164
|
-
"\\.[jt]sx?$": [
|
|
165
|
-
"babel-jest",
|
|
166
|
-
// When jest runs tests in parallel, it serializes the config before passing down options to babel
|
|
167
|
-
// that's why these must be serializable. Passing the reference to a config instead.
|
|
168
|
-
{
|
|
169
|
-
configFile: path.resolve(__dirname, "./webBabelConfig.js")
|
|
170
|
-
}
|
|
171
|
-
]
|
|
172
|
-
},
|
|
173
|
-
// Jest's default is to not transform anything in node_modules, but `.mjs`
|
|
174
|
-
// files (and until-async, @cedarjs/auth-*-web, @cedarjs/forms,
|
|
175
|
-
// @cedarjs/web, @cedarjs/auth, and @cedarjs/router) have to be compiled to
|
|
176
|
-
// CommonJS (see the transform above).
|
|
177
|
-
// The `.pnpm` lookahead is what makes this work with pnpm: its virtual store
|
|
178
|
-
// puts packages at `node_modules/.pnpm/<pkg>@<version>/node_modules/<pkg>`,
|
|
179
|
-
// so without it the pattern matches (and thereby ignores) at the *first*
|
|
180
|
-
// `node_modules` segment, where the following path starts with `.pnpm/`
|
|
181
|
-
// instead of `until-async/` and the exception never gets a chance to apply.
|
|
182
|
-
// Skipping that segment forces the match onto the inner `node_modules`,
|
|
183
|
-
// which looks the same as a hoisted npm/yarn layout
|
|
184
|
-
transformIgnorePatterns: [
|
|
185
|
-
"[/\\\\]node_modules[/\\\\](?!\\.pnpm[/\\\\])(?!.*\\.mjs$)(?!until-async[/\\\\])(?!@cedarjs[/\\\\]auth-[a-z-]+-web[/\\\\])(?!@cedarjs[/\\\\]forms[/\\\\])(?!@cedarjs[/\\\\]web[/\\\\])(?!@cedarjs[/\\\\]auth[/\\\\])(?!@cedarjs[/\\\\]router[/\\\\])",
|
|
186
|
-
"\\.pnp\\.[^\\\\/]+$"
|
|
187
|
-
],
|
|
188
|
-
resolver: path.resolve(__dirname, "./resolver.js"),
|
|
189
|
-
testPathIgnorePatterns: [".(stories|mock).[jt]sx?$"]
|
|
190
|
-
};
|
|
191
|
-
var jest_preset_default = config;
|
|
192
|
-
export {
|
|
193
|
-
jest_preset_default as default
|
|
194
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import '@testing-library/jest-dom';
|
|
2
|
-
import { mockCurrentUser as _mockCurrentUser } from '../../../web/mockRequests.js';
|
|
3
|
-
declare global {
|
|
4
|
-
var __RWJS_TESTROOT_DIR: string;
|
|
5
|
-
var mockCurrentUser: typeof _mockCurrentUser;
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=jest.setup.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jest.setup.d.ts","sourceRoot":"","sources":["../../../../src/config/jest/web/jest.setup.ts"],"names":[],"mappings":"AAEA,OAAO,2BAA2B,CAAA;AAGlC,OAAO,EAML,eAAe,IAAI,gBAAgB,EACpC,MAAM,8BAA8B,CAAA;AAErC,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,mBAAmB,EAAE,MAAM,CAAA;IAE/B,IAAI,eAAe,EAAE,OAAO,gBAAgB,CAAA;CAC7C"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import "@testing-library/jest-dom";
|
|
2
|
-
import { findCellMocks } from "../../../web/findCellMocks.js";
|
|
3
|
-
import {
|
|
4
|
-
startMSW,
|
|
5
|
-
setupRequestHandlers,
|
|
6
|
-
closeServer,
|
|
7
|
-
mockGraphQLMutation as _mockGraphQLMutation,
|
|
8
|
-
mockGraphQLQuery as _mockGraphQLQuery,
|
|
9
|
-
mockCurrentUser as _mockCurrentUser
|
|
10
|
-
} from "../../../web/mockRequests.js";
|
|
11
|
-
global.mockGraphQLQuery = _mockGraphQLQuery;
|
|
12
|
-
global.mockGraphQLMutation = _mockGraphQLMutation;
|
|
13
|
-
global.mockCurrentUser = _mockCurrentUser;
|
|
14
|
-
const cellMocks = findCellMocks(global.__RWJS_TESTROOT_DIR);
|
|
15
|
-
beforeAll(async () => {
|
|
16
|
-
for (const m of cellMocks) {
|
|
17
|
-
await import(m);
|
|
18
|
-
}
|
|
19
|
-
await startMSW("node");
|
|
20
|
-
setupRequestHandlers();
|
|
21
|
-
});
|
|
22
|
-
afterEach(() => {
|
|
23
|
-
setupRequestHandlers();
|
|
24
|
-
});
|
|
25
|
-
afterAll(() => {
|
|
26
|
-
closeServer();
|
|
27
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../../../src/config/jest/web/resolver.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAEnD,iBAAS,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,UAYvD;AAMD,SAAS,QAAQ,CAAA"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
2
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
3
|
-
try {
|
|
4
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
5
|
-
} catch (e) {
|
|
6
|
-
throw mod = 0, e;
|
|
7
|
-
}
|
|
8
|
-
};
|
|
9
|
-
var require_resolver = __commonJS({
|
|
10
|
-
"src/config/jest/web/resolver.ts"(exports, module) {
|
|
11
|
-
function resolver(path, options) {
|
|
12
|
-
return options.defaultResolver(path, {
|
|
13
|
-
...options,
|
|
14
|
-
packageFilter: (pkg) => {
|
|
15
|
-
if (OVERRIDE_EXPORTS_LIST.has(pkg.name)) {
|
|
16
|
-
delete pkg["exports"];
|
|
17
|
-
delete pkg["module"];
|
|
18
|
-
}
|
|
19
|
-
return pkg;
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
const OVERRIDE_EXPORTS_LIST = /* @__PURE__ */ new Set([
|
|
24
|
-
"@firebase/analytics",
|
|
25
|
-
"@firebase/app",
|
|
26
|
-
"@firebase/app-check",
|
|
27
|
-
"@firebase/auth",
|
|
28
|
-
"@firebase/database",
|
|
29
|
-
"@firebase/firestore",
|
|
30
|
-
"@firebase/functions",
|
|
31
|
-
"@firebase/installations",
|
|
32
|
-
"@firebase/messaging",
|
|
33
|
-
"@firebase/performance",
|
|
34
|
-
"@firebase/remote-config",
|
|
35
|
-
"@firebase/storage",
|
|
36
|
-
"@firebase/util",
|
|
37
|
-
"firebase"
|
|
38
|
-
]);
|
|
39
|
-
module.exports = resolver;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
export default require_resolver();
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
overrides: import("@babel/core").TransformOptions[];
|
|
3
|
-
presets: ((string | undefined)[] | (string | object)[])[];
|
|
4
|
-
plugins: import("@babel/core").TransformOptions[];
|
|
5
|
-
extends: string | undefined;
|
|
6
|
-
babelrc: boolean;
|
|
7
|
-
ignore: string[];
|
|
8
|
-
};
|
|
9
|
-
export default _default;
|
|
10
|
-
//# sourceMappingURL=webBabelConfig.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"webBabelConfig.d.ts","sourceRoot":"","sources":["../../../../src/config/jest/web/webBabelConfig.ts"],"names":[],"mappings":";;;;;;;;AAQA,wBASC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { getWebSideDefaultBabelConfig } from "@cedarjs/babel-config";
|
|
2
|
-
import redwoodCellsPlugin from "../babelPlugins/babel-plugin-redwood-cell.js";
|
|
3
|
-
const defaultWebSideBabelConfig = getWebSideDefaultBabelConfig({
|
|
4
|
-
forJest: true
|
|
5
|
-
});
|
|
6
|
-
var webBabelConfig_default = {
|
|
7
|
-
...defaultWebSideBabelConfig,
|
|
8
|
-
overrides: [
|
|
9
|
-
...defaultWebSideBabelConfig.overrides,
|
|
10
|
-
{
|
|
11
|
-
test: /.+Cell.(js|tsx|jsx)$/,
|
|
12
|
-
plugins: [redwoodCellsPlugin]
|
|
13
|
-
}
|
|
14
|
-
]
|
|
15
|
-
};
|
|
16
|
-
export {
|
|
17
|
-
webBabelConfig_default as default
|
|
18
|
-
};
|
package/dist/web/fileMock.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Lets Jest gracefully handle asset files such as stylesheets and images.
|
|
3
|
-
* Usually, these files aren't particularly useful in tests so we can safely
|
|
4
|
-
* mock them out. Asset imports are mapped to this module by the
|
|
5
|
-
* `moduleNameMapper` config in
|
|
6
|
-
* `packages/testing/src/config/jest/web/jest-preset.ts`.
|
|
7
|
-
*/
|
|
8
|
-
declare const _default: "fileMock";
|
|
9
|
-
export default _default;
|
|
10
|
-
//# sourceMappingURL=fileMock.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fileMock.d.ts","sourceRoot":"","sources":["../../src/web/fileMock.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;wBACY,UAAU;AAAzB,wBAAyB"}
|
package/dist/web/fileMock.js
DELETED