@ohos-ports/redwoodjs-testing 8.9.0-beta.0 → 8.9.0-beta.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.
|
@@ -48,9 +48,15 @@ module.exports = {
|
|
|
48
48
|
moduleNameMapper: {
|
|
49
49
|
// @NOTE: Import @redwoodjs/testing in api tests, and it automatically remaps to the api side only
|
|
50
50
|
// This is to prevent web stuff leaking into api, and vice versa
|
|
51
|
+
// (the '^@redwoodjs/testing$' key is the public contract intercepting
|
|
52
|
+
// Redwood-convention imports; the @ohos-ports port keeps BOTH keys)
|
|
51
53
|
'^@redwoodjs/testing$': path.join(
|
|
52
54
|
NODE_MODULES_PATH,
|
|
53
|
-
'@redwoodjs
|
|
55
|
+
'@ohos-ports/redwoodjs-testing/api',
|
|
56
|
+
),
|
|
57
|
+
'^@ohos-ports/redwoodjs-testing$': path.join(
|
|
58
|
+
NODE_MODULES_PATH,
|
|
59
|
+
'@ohos-ports/redwoodjs-testing/api',
|
|
54
60
|
),
|
|
55
61
|
},
|
|
56
62
|
transform: {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// @NOTE without these imports in the setup file, mockCurrentUser
|
|
5
5
|
// will remain undefined in the user's tests
|
|
6
6
|
// Remember to use specific imports
|
|
7
|
-
const { defineScenario } = require('@redwoodjs
|
|
7
|
+
const { defineScenario } = require('@ohos-ports/redwoodjs-testing/dist/api/scenario')
|
|
8
8
|
|
|
9
9
|
// @NOTE we do this because jest.setup.js runs every time in each context
|
|
10
10
|
// while jest-preset runs once. This significantly reduces memory footprint, and testing time
|
|
@@ -52,7 +52,7 @@ module.exports = {
|
|
|
52
52
|
// We replace imports to "@redwoodjs/router" with our own "mock" implementation.
|
|
53
53
|
'^@redwoodjs/router$': path.join(
|
|
54
54
|
NODE_MODULES_PATH,
|
|
55
|
-
'@redwoodjs
|
|
55
|
+
'@ohos-ports/redwoodjs-testing/dist/web/MockRouter.js',
|
|
56
56
|
),
|
|
57
57
|
'^@redwoodjs/web$': path.join(NODE_MODULES_PATH, '@redwoodjs/web/dist/cjs'),
|
|
58
58
|
|
|
@@ -60,14 +60,20 @@ module.exports = {
|
|
|
60
60
|
// clients, which in turn lets us mock `useAuth` in tests
|
|
61
61
|
'^@redwoodjs/auth$': path.join(
|
|
62
62
|
NODE_MODULES_PATH,
|
|
63
|
-
'@redwoodjs
|
|
63
|
+
'@ohos-ports/redwoodjs-testing/dist/web/mockAuth.js',
|
|
64
64
|
),
|
|
65
65
|
|
|
66
66
|
// @NOTE: Import @redwoodjs/testing in web tests, and it automatically remaps to the web side only
|
|
67
67
|
// This is to prevent web stuff leaking into api, and vice versa
|
|
68
|
+
// (the '^@redwoodjs/testing$' key is the public contract intercepting
|
|
69
|
+
// Redwood-convention imports; the @ohos-ports port keeps BOTH keys)
|
|
68
70
|
'^@redwoodjs/testing$': path.join(
|
|
69
71
|
NODE_MODULES_PATH,
|
|
70
|
-
'@redwoodjs
|
|
72
|
+
'@ohos-ports/redwoodjs-testing/web',
|
|
73
|
+
),
|
|
74
|
+
'^@ohos-ports/redwoodjs-testing$': path.join(
|
|
75
|
+
NODE_MODULES_PATH,
|
|
76
|
+
'@ohos-ports/redwoodjs-testing/web',
|
|
71
77
|
),
|
|
72
78
|
'~__REDWOOD__USER_ROUTES_FOR_MOCK': rwjsPaths.web.routes,
|
|
73
79
|
'~__REDWOOD__USER_AUTH_FOR_MOCK': path.join(rwjsPaths.web.src, 'auth'),
|
|
@@ -75,7 +81,7 @@ module.exports = {
|
|
|
75
81
|
* Mock out files that aren't particularly useful in tests. See fileMock.js for more info.
|
|
76
82
|
*/
|
|
77
83
|
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|css)$':
|
|
78
|
-
'@redwoodjs
|
|
84
|
+
'@ohos-ports/redwoodjs-testing/dist/web/fileMock.js',
|
|
79
85
|
},
|
|
80
86
|
transform: {
|
|
81
87
|
'\\.[jt]sx?$': [
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
require('@testing-library/jest-dom')
|
|
4
4
|
require('whatwg-fetch')
|
|
5
5
|
|
|
6
|
-
const { findCellMocks } = require('@redwoodjs
|
|
6
|
+
const { findCellMocks } = require('@ohos-ports/redwoodjs-testing/dist/web/findCellMocks')
|
|
7
7
|
const {
|
|
8
8
|
startMSW,
|
|
9
9
|
setupRequestHandlers,
|
|
@@ -11,7 +11,7 @@ const {
|
|
|
11
11
|
mockGraphQLMutation,
|
|
12
12
|
mockGraphQLQuery,
|
|
13
13
|
mockCurrentUser,
|
|
14
|
-
} = require('@redwoodjs
|
|
14
|
+
} = require('@ohos-ports/redwoodjs-testing/dist/web/mockRequests')
|
|
15
15
|
|
|
16
16
|
global.mockGraphQLQuery = mockGraphQLQuery
|
|
17
17
|
global.mockGraphQLMutation = mockGraphQLMutation
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ohos-ports/redwoodjs-testing",
|
|
3
|
-
"version": "8.9.0-beta.
|
|
3
|
+
"version": "8.9.0-beta.1",
|
|
4
4
|
"description": "Tools, wrappers and configuration for testing a Redwood project.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url": "https://github.com/
|
|
8
|
-
"directory": "
|
|
7
|
+
"url": "git+https://github.com/redwoodjs/redwood.git",
|
|
8
|
+
"directory": "packages/testing"
|
|
9
9
|
},
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"type": "commonjs",
|
|
@@ -49,16 +49,17 @@
|
|
|
49
49
|
"jest-watch-typeahead": "2.2.2",
|
|
50
50
|
"msw": "1.3.4",
|
|
51
51
|
"ts-toolbelt": "9.6.0",
|
|
52
|
-
"whatwg-fetch": "3.6.20"
|
|
52
|
+
"whatwg-fetch": "3.6.20",
|
|
53
|
+
"@redwoodjs/server-store": "npm:@ohos-ports/redwoodjs-server-store@8.9.0"
|
|
53
54
|
},
|
|
54
55
|
"devDependencies": {
|
|
55
56
|
"@redwoodjs/framework-tools": "8.9.0",
|
|
56
57
|
"concurrently": "8.2.2",
|
|
57
58
|
"jsdom": "24.1.3",
|
|
58
59
|
"publint": "0.3.12",
|
|
59
|
-
"tsx": "
|
|
60
|
+
"tsx": "4.19.2",
|
|
60
61
|
"typescript": "5.6.2",
|
|
61
|
-
"vitest": "
|
|
62
|
+
"vitest": "2.1.9"
|
|
62
63
|
},
|
|
63
64
|
"gitHead": "781e41fc681d6a744d3feca44bcf01b1b83fa55d"
|
|
64
|
-
}
|
|
65
|
+
}
|