@websolutespa/test 0.0.4 → 0.1.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.
- package/CHANGELOG.md +13 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.js +59 -0
- package/dist/index.mjs +65 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Config } from 'jest';
|
|
2
2
|
|
|
3
|
-
declare const baseConfig: Config;
|
|
4
|
-
declare function getProjectConfig(): {};
|
|
5
|
-
declare function getAppConfig(): {};
|
|
3
|
+
declare const baseConfig: Config;
|
|
4
|
+
declare function getProjectConfig(): {};
|
|
5
|
+
declare function getAppConfig(): {};
|
|
6
6
|
declare function getPackageConfig(): {};
|
|
7
|
+
declare function getPayloadConfig(): {};
|
|
7
8
|
|
|
8
|
-
export { baseConfig, getAppConfig, getPackageConfig, getProjectConfig };
|
|
9
|
+
export { baseConfig, getAppConfig, getPackageConfig, getPayloadConfig, getProjectConfig };
|
package/dist/index.js
CHANGED
|
@@ -50,6 +50,7 @@ __export(test_exports, {
|
|
|
50
50
|
baseConfig: () => baseConfig,
|
|
51
51
|
getAppConfig: () => getAppConfig,
|
|
52
52
|
getPackageConfig: () => getPackageConfig,
|
|
53
|
+
getPayloadConfig: () => getPayloadConfig,
|
|
53
54
|
getProjectConfig: () => getProjectConfig
|
|
54
55
|
});
|
|
55
56
|
module.exports = __toCommonJS(test_exports);
|
|
@@ -133,6 +134,10 @@ function getProjectConfig() {
|
|
|
133
134
|
// '^@/components/(.*)$': '<rootDir>/components/$1',
|
|
134
135
|
// '^@/pages/(.*)$': '<rootDir>/pages/$1',
|
|
135
136
|
},
|
|
137
|
+
modulePathIgnorePatterns: [
|
|
138
|
+
"<rootDir>/build/",
|
|
139
|
+
"<rootDir>/.next/"
|
|
140
|
+
],
|
|
136
141
|
transformIgnorePatterns: [
|
|
137
142
|
"node_modules",
|
|
138
143
|
"node_modules/(?!(swiper|swiper/react|ssr-window|dom7)/)"
|
|
@@ -187,14 +192,68 @@ function getPackageConfig() {
|
|
|
187
192
|
}
|
|
188
193
|
}]
|
|
189
194
|
},
|
|
195
|
+
modulePathIgnorePatterns: [
|
|
196
|
+
"<rootDir>/build/"
|
|
197
|
+
],
|
|
190
198
|
transformIgnorePatterns: ["node_modules/(?!swiper)/"]
|
|
191
199
|
});
|
|
192
200
|
return config;
|
|
193
201
|
}
|
|
202
|
+
function getPayloadConfig() {
|
|
203
|
+
const cwd = process.cwd();
|
|
204
|
+
const config = __spreadProps(__spreadValues({}, baseConfig), {
|
|
205
|
+
testEnvironment: "node",
|
|
206
|
+
testTimeout: 2e4,
|
|
207
|
+
verbose: true,
|
|
208
|
+
silent: true,
|
|
209
|
+
rootDir: ".",
|
|
210
|
+
roots: [
|
|
211
|
+
`${cwd}`
|
|
212
|
+
],
|
|
213
|
+
modulePaths: [
|
|
214
|
+
`${cwd}/src/`
|
|
215
|
+
],
|
|
216
|
+
moduleDirectories: [
|
|
217
|
+
"node_modules"
|
|
218
|
+
],
|
|
219
|
+
testMatch: [
|
|
220
|
+
"<rootDir>/src/**/*(?<!e2e).test.{js,jsx,ts,tsx}"
|
|
221
|
+
],
|
|
222
|
+
coverageDirectory: `${cwd}/coverage`,
|
|
223
|
+
collectCoverageFrom: [
|
|
224
|
+
"<rootDir>/src/**/*(?<!test).{js,jsx,ts,tsx}"
|
|
225
|
+
],
|
|
226
|
+
reporters: ["default", "github-actions"],
|
|
227
|
+
coverageReporters: ["html", "text", "text-summary", "lcov"],
|
|
228
|
+
transform: {
|
|
229
|
+
"^.+\\.(js|jsx|ts|tsx)?$": ["@swc/jest", {
|
|
230
|
+
jsc: {
|
|
231
|
+
transform: {
|
|
232
|
+
react: {
|
|
233
|
+
runtime: "automatic"
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}]
|
|
238
|
+
},
|
|
239
|
+
modulePathIgnorePatterns: [
|
|
240
|
+
"<rootDir>/build/"
|
|
241
|
+
],
|
|
242
|
+
transformIgnorePatterns: ["node_modules/(?!swiper)/"],
|
|
243
|
+
moduleNameMapper: {
|
|
244
|
+
// Force module uuid to resolve with the CJS entry point, because Jest does not support package.json.exports. See https://github.com/uuidjs/uuid/issues/451
|
|
245
|
+
"uuid": require.resolve("uuid"),
|
|
246
|
+
"\\.(css|scss)$": "identity-obj-proxy",
|
|
247
|
+
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/jest.mock.file.js"
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
return config;
|
|
251
|
+
}
|
|
194
252
|
// Annotate the CommonJS export names for ESM import in node:
|
|
195
253
|
0 && (module.exports = {
|
|
196
254
|
baseConfig,
|
|
197
255
|
getAppConfig,
|
|
198
256
|
getPackageConfig,
|
|
257
|
+
getPayloadConfig,
|
|
199
258
|
getProjectConfig
|
|
200
259
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -17,6 +17,13 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
21
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
22
|
+
}) : x)(function(x) {
|
|
23
|
+
if (typeof require !== "undefined")
|
|
24
|
+
return require.apply(this, arguments);
|
|
25
|
+
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
26
|
+
});
|
|
20
27
|
|
|
21
28
|
// index.ts
|
|
22
29
|
import nextJest from "next/jest";
|
|
@@ -99,6 +106,10 @@ function getProjectConfig() {
|
|
|
99
106
|
// '^@/components/(.*)$': '<rootDir>/components/$1',
|
|
100
107
|
// '^@/pages/(.*)$': '<rootDir>/pages/$1',
|
|
101
108
|
},
|
|
109
|
+
modulePathIgnorePatterns: [
|
|
110
|
+
"<rootDir>/build/",
|
|
111
|
+
"<rootDir>/.next/"
|
|
112
|
+
],
|
|
102
113
|
transformIgnorePatterns: [
|
|
103
114
|
"node_modules",
|
|
104
115
|
"node_modules/(?!(swiper|swiper/react|ssr-window|dom7)/)"
|
|
@@ -153,13 +164,67 @@ function getPackageConfig() {
|
|
|
153
164
|
}
|
|
154
165
|
}]
|
|
155
166
|
},
|
|
167
|
+
modulePathIgnorePatterns: [
|
|
168
|
+
"<rootDir>/build/"
|
|
169
|
+
],
|
|
156
170
|
transformIgnorePatterns: ["node_modules/(?!swiper)/"]
|
|
157
171
|
});
|
|
158
172
|
return config;
|
|
159
173
|
}
|
|
174
|
+
function getPayloadConfig() {
|
|
175
|
+
const cwd = process.cwd();
|
|
176
|
+
const config = __spreadProps(__spreadValues({}, baseConfig), {
|
|
177
|
+
testEnvironment: "node",
|
|
178
|
+
testTimeout: 2e4,
|
|
179
|
+
verbose: true,
|
|
180
|
+
silent: true,
|
|
181
|
+
rootDir: ".",
|
|
182
|
+
roots: [
|
|
183
|
+
`${cwd}`
|
|
184
|
+
],
|
|
185
|
+
modulePaths: [
|
|
186
|
+
`${cwd}/src/`
|
|
187
|
+
],
|
|
188
|
+
moduleDirectories: [
|
|
189
|
+
"node_modules"
|
|
190
|
+
],
|
|
191
|
+
testMatch: [
|
|
192
|
+
"<rootDir>/src/**/*(?<!e2e).test.{js,jsx,ts,tsx}"
|
|
193
|
+
],
|
|
194
|
+
coverageDirectory: `${cwd}/coverage`,
|
|
195
|
+
collectCoverageFrom: [
|
|
196
|
+
"<rootDir>/src/**/*(?<!test).{js,jsx,ts,tsx}"
|
|
197
|
+
],
|
|
198
|
+
reporters: ["default", "github-actions"],
|
|
199
|
+
coverageReporters: ["html", "text", "text-summary", "lcov"],
|
|
200
|
+
transform: {
|
|
201
|
+
"^.+\\.(js|jsx|ts|tsx)?$": ["@swc/jest", {
|
|
202
|
+
jsc: {
|
|
203
|
+
transform: {
|
|
204
|
+
react: {
|
|
205
|
+
runtime: "automatic"
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}]
|
|
210
|
+
},
|
|
211
|
+
modulePathIgnorePatterns: [
|
|
212
|
+
"<rootDir>/build/"
|
|
213
|
+
],
|
|
214
|
+
transformIgnorePatterns: ["node_modules/(?!swiper)/"],
|
|
215
|
+
moduleNameMapper: {
|
|
216
|
+
// Force module uuid to resolve with the CJS entry point, because Jest does not support package.json.exports. See https://github.com/uuidjs/uuid/issues/451
|
|
217
|
+
"uuid": __require.resolve("uuid"),
|
|
218
|
+
"\\.(css|scss)$": "identity-obj-proxy",
|
|
219
|
+
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/jest.mock.file.js"
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
return config;
|
|
223
|
+
}
|
|
160
224
|
export {
|
|
161
225
|
baseConfig,
|
|
162
226
|
getAppConfig,
|
|
163
227
|
getPackageConfig,
|
|
228
|
+
getPayloadConfig,
|
|
164
229
|
getProjectConfig
|
|
165
230
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@websolutespa/test",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Test shared config of the BOM Repository",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bom",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"jest": "^29.3.1"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"next": ">=
|
|
34
|
+
"next": ">= 13.4.19"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/jest": "^29.2.4",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"npm-run-all": "^4.1.5",
|
|
40
40
|
"ts-node": "^10.9.1",
|
|
41
41
|
"tsup": "^6.7.0",
|
|
42
|
-
"typescript": "^
|
|
42
|
+
"typescript": "^5.1.6"
|
|
43
43
|
},
|
|
44
44
|
"publishConfig": {
|
|
45
45
|
"access": "public"
|