@websolutespa/test 3.0.1 → 3.1.0

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/index.cjs DELETED
@@ -1,246 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // index.ts
31
- var index_exports = {};
32
- __export(index_exports, {
33
- baseConfig: () => baseConfig,
34
- getAppConfig: () => getAppConfig,
35
- getPackageConfig: () => getPackageConfig,
36
- getPayloadConfig: () => getPayloadConfig,
37
- getProjectConfig: () => getProjectConfig
38
- });
39
- module.exports = __toCommonJS(index_exports);
40
- var import_jest = __toESM(require("next/jest"), 1);
41
- var createJestConfig = (0, import_jest.default)({
42
- // Provide the path to your Next.js app to load next.config.js and .env files in your test environment
43
- dir: "./"
44
- });
45
- var baseConfig = {
46
- verbose: false,
47
- silent: false,
48
- testTimeout: process.env.CI ? 2e4 : 1e4,
49
- // testEnvironment: 'jsdom',
50
- testEnvironment: "jest-environment-jsdom",
51
- // setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
52
- reporters: ["default", "github-actions"],
53
- /*
54
- snapshotFormat: {
55
- printBasicPrototype: false,
56
- },
57
- */
58
- /*
59
- coverageThreshold: {
60
- global: {
61
- branches: 80,
62
- functions: 80,
63
- lines: 80,
64
- statements: 80,
65
- }
66
- },
67
- */
68
- coverageReporters: ["html", "text", "text-summary", "lcov"]
69
- };
70
- function getProjectConfig() {
71
- const cwd = process.cwd();
72
- const config = {
73
- ...baseConfig,
74
- rootDir: ".",
75
- roots: [
76
- `${cwd}`
77
- ],
78
- resetMocks: true,
79
- modulePaths: [
80
- `${cwd}/src/`
81
- ],
82
- moduleDirectories: [
83
- "node_modules"
84
- ],
85
- testMatch: [
86
- "<rootDir>/src/**/*(?<!e2e).test.{js,jsx,ts,tsx}"
87
- ],
88
- coverageDirectory: `${cwd}/coverage`,
89
- collectCoverageFrom: [
90
- "<rootDir>/src/**/*(?<!test).{js,jsx,ts,tsx}"
91
- ],
92
- setupFilesAfterEnv: [`${cwd}/jest.setup.js`],
93
- transform: {
94
- "^.+\\.(js|jsx|ts|tsx)?$": ["@swc/jest", {
95
- jsc: {
96
- transform: {
97
- react: {
98
- runtime: "automatic"
99
- }
100
- }
101
- }
102
- }]
103
- },
104
- // Rewrite Swiper ESM imports as paths (allows them to be transformed w/o errors)
105
- moduleNameMapper: {
106
- "\\.(css|scss)$": "identity-obj-proxy",
107
- "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/src/packages/test/jest.mock.file.js",
108
- // swiper
109
- "swiper": "<rootDir>/node_modules/swiper/swiper-bundle.js",
110
- "swiper/react": "<rootDir>/node_modules/swiper/react/swiper-react.js"
111
- // 'swiper/css': '<rootDir>/node_modules/swiper/swiper.min.css',
112
- // 'swiper/css/bundle': '<rootDir>/node_modules/swiper/swiper-bundle.min.css',
113
- // 'swiper/css/autoplay': '<rootDir>/node_modules/swiper/modules/autoplay/autoplay.min.css',
114
- // 'swiper/css/free-mode': '<rootDir>/node_modules/swiper/modules/autoplay/free-mode.min.css',
115
- // 'swiper/css/navigation': '<rootDir>/node_modules/swiper/modules/autoplay/navigation.min.css',
116
- // 'swiper/css/pagination': '<rootDir>/node_modules/swiper/modules/autoplay/pagination.min.css',
117
- // Handle module aliases (this will be automatically configured for you soon)
118
- // '^@/components/(.*)$': '<rootDir>/components/$1',
119
- // '^@/pages/(.*)$': '<rootDir>/pages/$1',
120
- },
121
- modulePathIgnorePatterns: [
122
- "<rootDir>/build/",
123
- "<rootDir>/.next/"
124
- ],
125
- transformIgnorePatterns: [
126
- "node_modules",
127
- "node_modules/(?!(swiper|swiper/react|ssr-window|dom7)/)"
128
- ]
129
- };
130
- return config;
131
- }
132
- function getAppConfig() {
133
- const config = getProjectConfig();
134
- config.transform = {
135
- "^.+\\.(js|jsx|ts|tsx)?$": ["@swc/jest", {
136
- jsc: {
137
- transform: {
138
- react: {
139
- runtime: "automatic"
140
- }
141
- }
142
- },
143
- tsconfig: "tsconfig.test.json"
144
- }]
145
- };
146
- return createJestConfig(config);
147
- }
148
- function getPackageConfig() {
149
- const cwd = process.cwd();
150
- const config = {
151
- ...baseConfig,
152
- rootDir: ".",
153
- roots: [
154
- `${cwd}`
155
- ],
156
- modulePaths: [
157
- `${cwd}/src/`
158
- ],
159
- moduleDirectories: [
160
- "node_modules"
161
- ],
162
- testMatch: [
163
- "<rootDir>/src/**/*(?<!e2e).test.{js,jsx,ts,tsx}"
164
- ],
165
- coverageDirectory: `${cwd}/coverage`,
166
- collectCoverageFrom: [
167
- "<rootDir>/src/**/*(?<!test).{js,jsx,ts,tsx}"
168
- ],
169
- transform: {
170
- "^.+\\.(js|jsx|ts|tsx)?$": ["@swc/jest", {
171
- jsc: {
172
- transform: {
173
- react: {
174
- runtime: "automatic"
175
- }
176
- }
177
- }
178
- }]
179
- },
180
- modulePathIgnorePatterns: [
181
- "<rootDir>/build/"
182
- ],
183
- transformIgnorePatterns: ["node_modules/(?!swiper)/"]
184
- };
185
- return config;
186
- }
187
- function getPayloadConfig() {
188
- const cwd = process.cwd();
189
- const config = {
190
- ...baseConfig,
191
- // testEnvironment: '<rootDir>/jest.environment.ts',
192
- testEnvironment: "node",
193
- testTimeout: 2e4,
194
- verbose: true,
195
- silent: true,
196
- rootDir: ".",
197
- roots: [
198
- `${cwd}`
199
- ],
200
- modulePaths: [
201
- `${cwd}/src/`
202
- ],
203
- moduleDirectories: [
204
- "node_modules"
205
- ],
206
- testMatch: [
207
- "<rootDir>/src/**/*(?<!e2e).test.{js,jsx,ts,tsx}"
208
- ],
209
- coverageDirectory: `${cwd}/coverage`,
210
- collectCoverageFrom: [
211
- "<rootDir>/src/**/*(?<!test).{js,jsx,ts,tsx}"
212
- ],
213
- reporters: ["default", "github-actions"],
214
- coverageReporters: ["html", "text", "text-summary", "lcov"],
215
- transform: {
216
- "^.+\\.(js|jsx|ts|tsx)?$": ["@swc/jest", {
217
- jsc: {
218
- transform: {
219
- react: {
220
- runtime: "automatic"
221
- }
222
- }
223
- }
224
- }]
225
- },
226
- modulePathIgnorePatterns: [
227
- "<rootDir>/build/"
228
- ],
229
- transformIgnorePatterns: ["node_modules/(?!swiper)/"],
230
- moduleNameMapper: {
231
- // 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
232
- "uuid": require.resolve("uuid"),
233
- "\\.(css|scss)$": "identity-obj-proxy",
234
- "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/jest.mock.file.js"
235
- }
236
- };
237
- return config;
238
- }
239
- // Annotate the CommonJS export names for ESM import in node:
240
- 0 && (module.exports = {
241
- baseConfig,
242
- getAppConfig,
243
- getPackageConfig,
244
- getPayloadConfig,
245
- getProjectConfig
246
- });
package/dist/index.d.cts DELETED
@@ -1,9 +0,0 @@
1
- import { Config } from 'jest';
2
-
3
- declare const baseConfig: Config;
4
- declare function getProjectConfig(): {};
5
- declare function getAppConfig(): {};
6
- declare function getPackageConfig(): {};
7
- declare function getPayloadConfig(): {};
8
-
9
- export { baseConfig, getAppConfig, getPackageConfig, getPayloadConfig, getProjectConfig };