@elliemae/pui-cli 9.0.0-next.28 → 9.0.0-next.29
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/testing/ExtendedJSDomEnv.cjs +0 -11
- package/dist/cjs/testing/jest.config.cjs +2 -1
- package/dist/cjs/testing/jest.polyfills.cjs +28 -0
- package/dist/esm/testing/ExtendedJSDomEnv.cjs +0 -11
- package/dist/esm/testing/jest.config.cjs +2 -1
- package/dist/esm/testing/jest.polyfills.cjs +28 -0
- package/dist/types/testing/jest.config.d.cts +1 -0
- package/dist/types/testing/jest.node.config.d.cts +1 -0
- package/dist/types/testing/jest.polyfills.d.cts +1 -0
- package/package.json +5 -4
|
@@ -22,17 +22,6 @@ class FixJSDOMEnvironment extends TestEnvironment {
|
|
|
22
22
|
|
|
23
23
|
// FIXME https://github.com/jsdom/jsdom/issues/3363
|
|
24
24
|
if (structuredClone) this.global.structuredClone = structuredClone;
|
|
25
|
-
|
|
26
|
-
// fix: 'TypeError: Failed to parse URL from latest/app.config.json' relative urls not supported in nodejs native fetch, using whatwg-fetch instead
|
|
27
|
-
// // FIXME https://github.com/jsdom/jsdom/issues/1724
|
|
28
|
-
// if (fetch) this.global.fetch = fetch;
|
|
29
|
-
// if (Headers) this.global.Headers = Headers;
|
|
30
|
-
// if (Request) this.global.Request = Request;
|
|
31
|
-
// if (Response) this.global.Response = Response;
|
|
32
|
-
|
|
33
|
-
// // FIXME https://github.com/jsdom/jsdom/issues/1721
|
|
34
|
-
// if (URL) this.global.URL = URL;
|
|
35
|
-
// if (Blob) this.global.Blob = Blob;
|
|
36
25
|
}
|
|
37
26
|
}
|
|
38
27
|
module.exports = FixJSDOMEnvironment;
|
|
@@ -75,7 +75,7 @@ const jestConfig = {
|
|
|
75
75
|
},
|
|
76
76
|
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
|
77
77
|
setupFilesAfterEnv: [path.resolve(__dirname, './setup-tests.js')],
|
|
78
|
-
setupFiles: ['raf/polyfill', '
|
|
78
|
+
setupFiles: ['raf/polyfill', './jest.polyfills.cjs'],
|
|
79
79
|
testRegex: '(app|lib).*/tests/.*\\.test\\.[jt]sx?$',
|
|
80
80
|
snapshotSerializers: [],
|
|
81
81
|
testResultsProcessor: 'jest-sonar-reporter',
|
|
@@ -93,6 +93,7 @@ const jestConfig = {
|
|
|
93
93
|
testEnvironmentOptions: {
|
|
94
94
|
url: `http://localhost:3111${basePath}`,
|
|
95
95
|
resources: 'usable',
|
|
96
|
+
customExportConditions: [''],
|
|
96
97
|
},
|
|
97
98
|
testEnvironment: path.resolve(__dirname, './ExtendedJSDomEnv.cjs'),
|
|
98
99
|
watchPlugins: [
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @note The block below contains polyfills for Node.js globals
|
|
3
|
+
* required for Jest to function when running JSDOM tests.
|
|
4
|
+
* These HAVE to be require's and HAVE to be in this exact
|
|
5
|
+
* order, since "undici" depends on the "TextEncoder" global API.
|
|
6
|
+
*
|
|
7
|
+
* Consider migrating to a more modern test runner if
|
|
8
|
+
* you don't want to deal with this.
|
|
9
|
+
*/
|
|
10
|
+
const { TextDecoder, TextEncoder } = require('node:util');
|
|
11
|
+
|
|
12
|
+
Object.defineProperties(globalThis, {
|
|
13
|
+
TextDecoder: { value: TextDecoder },
|
|
14
|
+
TextEncoder: { value: TextEncoder },
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const { Blob, File } = require('node:buffer');
|
|
18
|
+
const { fetch, Headers, FormData, Request, Response } = require('undici');
|
|
19
|
+
|
|
20
|
+
Object.defineProperties(globalThis, {
|
|
21
|
+
fetch: { value: fetch, writable: true },
|
|
22
|
+
Blob: { value: Blob },
|
|
23
|
+
File: { value: File },
|
|
24
|
+
Headers: { value: Headers },
|
|
25
|
+
FormData: { value: FormData },
|
|
26
|
+
Request: { value: Request },
|
|
27
|
+
Response: { value: Response },
|
|
28
|
+
});
|
|
@@ -22,17 +22,6 @@ class FixJSDOMEnvironment extends TestEnvironment {
|
|
|
22
22
|
|
|
23
23
|
// FIXME https://github.com/jsdom/jsdom/issues/3363
|
|
24
24
|
if (structuredClone) this.global.structuredClone = structuredClone;
|
|
25
|
-
|
|
26
|
-
// fix: 'TypeError: Failed to parse URL from latest/app.config.json' relative urls not supported in nodejs native fetch, using whatwg-fetch instead
|
|
27
|
-
// // FIXME https://github.com/jsdom/jsdom/issues/1724
|
|
28
|
-
// if (fetch) this.global.fetch = fetch;
|
|
29
|
-
// if (Headers) this.global.Headers = Headers;
|
|
30
|
-
// if (Request) this.global.Request = Request;
|
|
31
|
-
// if (Response) this.global.Response = Response;
|
|
32
|
-
|
|
33
|
-
// // FIXME https://github.com/jsdom/jsdom/issues/1721
|
|
34
|
-
// if (URL) this.global.URL = URL;
|
|
35
|
-
// if (Blob) this.global.Blob = Blob;
|
|
36
25
|
}
|
|
37
26
|
}
|
|
38
27
|
module.exports = FixJSDOMEnvironment;
|
|
@@ -75,7 +75,7 @@ const jestConfig = {
|
|
|
75
75
|
},
|
|
76
76
|
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
|
77
77
|
setupFilesAfterEnv: [path.resolve(__dirname, './setup-tests.js')],
|
|
78
|
-
setupFiles: ['raf/polyfill', '
|
|
78
|
+
setupFiles: ['raf/polyfill', './jest.polyfills.cjs'],
|
|
79
79
|
testRegex: '(app|lib).*/tests/.*\\.test\\.[jt]sx?$',
|
|
80
80
|
snapshotSerializers: [],
|
|
81
81
|
testResultsProcessor: 'jest-sonar-reporter',
|
|
@@ -93,6 +93,7 @@ const jestConfig = {
|
|
|
93
93
|
testEnvironmentOptions: {
|
|
94
94
|
url: `http://localhost:3111${basePath}`,
|
|
95
95
|
resources: 'usable',
|
|
96
|
+
customExportConditions: [''],
|
|
96
97
|
},
|
|
97
98
|
testEnvironment: path.resolve(__dirname, './ExtendedJSDomEnv.cjs'),
|
|
98
99
|
watchPlugins: [
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @note The block below contains polyfills for Node.js globals
|
|
3
|
+
* required for Jest to function when running JSDOM tests.
|
|
4
|
+
* These HAVE to be require's and HAVE to be in this exact
|
|
5
|
+
* order, since "undici" depends on the "TextEncoder" global API.
|
|
6
|
+
*
|
|
7
|
+
* Consider migrating to a more modern test runner if
|
|
8
|
+
* you don't want to deal with this.
|
|
9
|
+
*/
|
|
10
|
+
const { TextDecoder, TextEncoder } = require('node:util');
|
|
11
|
+
|
|
12
|
+
Object.defineProperties(globalThis, {
|
|
13
|
+
TextDecoder: { value: TextDecoder },
|
|
14
|
+
TextEncoder: { value: TextEncoder },
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const { Blob, File } = require('node:buffer');
|
|
18
|
+
const { fetch, Headers, FormData, Request, Response } = require('undici');
|
|
19
|
+
|
|
20
|
+
Object.defineProperties(globalThis, {
|
|
21
|
+
fetch: { value: fetch, writable: true },
|
|
22
|
+
Blob: { value: Blob },
|
|
23
|
+
File: { value: File },
|
|
24
|
+
Headers: { value: Headers },
|
|
25
|
+
FormData: { value: FormData },
|
|
26
|
+
Request: { value: Request },
|
|
27
|
+
Response: { value: Response },
|
|
28
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/pui-cli",
|
|
3
|
-
"version": "9.0.0-next.
|
|
3
|
+
"version": "9.0.0-next.29",
|
|
4
4
|
"description": "ICE MT UI Platform CLI",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"type": "module",
|
|
@@ -260,7 +260,7 @@
|
|
|
260
260
|
"postcss-preset-env": "~9.3.0",
|
|
261
261
|
"postcss-syntax": "~0.36.2",
|
|
262
262
|
"prettier": "~3.1.0",
|
|
263
|
-
"prisma": "~5.
|
|
263
|
+
"prisma": "~5.6.0",
|
|
264
264
|
"pug": "~3.0.2",
|
|
265
265
|
"pug-loader": "~2.4.0",
|
|
266
266
|
"raf": "~3.4.1",
|
|
@@ -285,9 +285,10 @@
|
|
|
285
285
|
"tsconfig-paths-webpack-plugin": "~4.1.0",
|
|
286
286
|
"ts-node": "~10.9.1",
|
|
287
287
|
"tsc-alias": "~1.8.8",
|
|
288
|
-
"tsx": "~4.1.
|
|
288
|
+
"tsx": "~4.1.2",
|
|
289
289
|
"typedoc": "~0.25.3",
|
|
290
290
|
"typescript": "~5.2.2",
|
|
291
|
+
"undici": "~5.27.2",
|
|
291
292
|
"update-notifier": "~7.0.0",
|
|
292
293
|
"url-loader": "~4.1.1",
|
|
293
294
|
"uuid": "~9.0.1",
|
|
@@ -295,7 +296,7 @@
|
|
|
295
296
|
"vitest": "~0.34.6",
|
|
296
297
|
"vite-tsconfig-paths": "~4.2.1",
|
|
297
298
|
"webpack": "~5.89.0",
|
|
298
|
-
"webpack-bundle-analyzer": "~4.
|
|
299
|
+
"webpack-bundle-analyzer": "~4.10.0",
|
|
299
300
|
"webpack-cli": "~5.1.4",
|
|
300
301
|
"webpack-dev-server": "~4.15.1",
|
|
301
302
|
"webpack-manifest-plugin": "~5.0.0",
|