@vyriy/jest-config 0.8.13 → 0.8.15
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/README.md +1 -1
- package/index.js +1 -3
- package/package.json +1 -11
- package/setup.cjs +17 -0
- package/setup.d.ts +0 -1
- package/setup.js +0 -15
package/README.md
CHANGED
|
@@ -70,7 +70,7 @@ Jest transformer, reporter, environment, and style proxy packages are resolved f
|
|
|
70
70
|
|
|
71
71
|
The transform ignore rules keep normal dependencies ignored but allow Vyriy packages and the ESM Markdown/unified ecosystem used by SSG and docs packages to pass through SWC.
|
|
72
72
|
|
|
73
|
-
JSDOM uses Node export conditions in this shared config so server-oriented packages, including the AWS SDK, resolve their Node builds during tests. A
|
|
73
|
+
JSDOM uses Node export conditions in this shared config so server-oriented packages, including the AWS SDK, resolve their Node builds during tests. A CommonJS setup file provides Node's `TextEncoder` and `TextDecoder` globals for dependencies that expect them at import time.
|
|
74
74
|
|
|
75
75
|
## Install
|
|
76
76
|
|
package/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';
|
|
2
|
-
import { extname } from 'node:path';
|
|
3
2
|
import { fileURLToPath } from 'node:url';
|
|
4
3
|
const requireFromPackage = createRequire(import.meta.url);
|
|
5
4
|
const resolveDependency = (request) => requireFromPackage.resolve(request);
|
|
6
|
-
const packageModuleExtension = extname(fileURLToPath(import.meta.url));
|
|
7
5
|
const resolvePackageFile = (path) => fileURLToPath(new URL(path, import.meta.url));
|
|
8
6
|
const transformEsmPackages = [
|
|
9
7
|
'@vyriy',
|
|
@@ -119,7 +117,7 @@ const config = {
|
|
|
119
117
|
],
|
|
120
118
|
resetMocks: false,
|
|
121
119
|
restoreMocks: true,
|
|
122
|
-
setupFiles: [resolvePackageFile(
|
|
120
|
+
setupFiles: [resolvePackageFile('./setup.cjs')],
|
|
123
121
|
testEnvironment: resolveDependency('jest-environment-jsdom'),
|
|
124
122
|
testEnvironmentOptions: {
|
|
125
123
|
customExportConditions: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vyriy/jest-config",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.15",
|
|
4
4
|
"description": "Shared Jest config for Vyriy projects",
|
|
5
5
|
"homepage": "https://vyriy.dev/docs/jest/",
|
|
6
6
|
"type": "module",
|
|
@@ -38,16 +38,6 @@
|
|
|
38
38
|
"types": "./index.d.ts",
|
|
39
39
|
"import": "./index.js",
|
|
40
40
|
"default": "./index.js"
|
|
41
|
-
},
|
|
42
|
-
"./setup": {
|
|
43
|
-
"types": "./setup.d.ts",
|
|
44
|
-
"import": "./setup.js",
|
|
45
|
-
"default": "./setup.js"
|
|
46
|
-
},
|
|
47
|
-
"./setup.js": {
|
|
48
|
-
"types": "./setup.d.ts",
|
|
49
|
-
"import": "./setup.js",
|
|
50
|
-
"default": "./setup.js"
|
|
51
41
|
}
|
|
52
42
|
}
|
|
53
43
|
}
|
package/setup.cjs
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const { TextDecoder, TextEncoder } = require('node:util');
|
|
2
|
+
|
|
3
|
+
if (!globalThis.TextDecoder) {
|
|
4
|
+
Object.defineProperty(globalThis, 'TextDecoder', {
|
|
5
|
+
configurable: true,
|
|
6
|
+
value: TextDecoder,
|
|
7
|
+
writable: true,
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
if (!globalThis.TextEncoder) {
|
|
12
|
+
Object.defineProperty(globalThis, 'TextEncoder', {
|
|
13
|
+
configurable: true,
|
|
14
|
+
value: TextEncoder,
|
|
15
|
+
writable: true,
|
|
16
|
+
});
|
|
17
|
+
}
|
package/setup.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/setup.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { TextDecoder, TextEncoder } from 'node:util';
|
|
2
|
-
if (!globalThis.TextDecoder) {
|
|
3
|
-
Object.defineProperty(globalThis, 'TextDecoder', {
|
|
4
|
-
configurable: true,
|
|
5
|
-
value: TextDecoder,
|
|
6
|
-
writable: true,
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
|
-
if (!globalThis.TextEncoder) {
|
|
10
|
-
Object.defineProperty(globalThis, 'TextEncoder', {
|
|
11
|
-
configurable: true,
|
|
12
|
-
value: TextEncoder,
|
|
13
|
-
writable: true,
|
|
14
|
-
});
|
|
15
|
-
}
|