@websolutespa/test 0.0.1 → 0.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
- # @websolutespa/test
2
-
3
- ## 0.0.1
4
-
5
- ### Patch Changes
6
-
7
- - Added: first release.
1
+ # @websolutespa/test
2
+
3
+ ## 0.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Added: first release.
package/README.md ADDED
@@ -0,0 +1,11 @@
1
+ # @websolutespa/test
2
+
3
+ [![npm version](https://badge.fury.io/js/%40websolutespa%2Ftest.svg)](https://badge.fury.io/js/%40websolutespa%2Ftest)
4
+
5
+ [![status alpha](https://img.shields.io/badge/status-alpha-red.svg)](https://shields.io/)
6
+
7
+ Test shared config of the [BOM Repository](https://github.com/websolutespa/bom) by [websolute](https://www.websolute.com/).
8
+
9
+ ---
10
+
11
+ ##### *this library is for internal usage and not production ready*
@@ -0,0 +1,8 @@
1
+ import { Config } from 'jest';
2
+
3
+ declare const baseConfig: Config;
4
+ declare function getProjectConfig(): {};
5
+ declare function getAppConfig(): {};
6
+ declare function getPackageConfig(): {};
7
+
8
+ export { baseConfig, getAppConfig, getPackageConfig, getProjectConfig };
package/dist/index.js ADDED
@@ -0,0 +1,200 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __defProps = Object.defineProperties;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
+ var __getProtoOf = Object.getPrototypeOf;
10
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
11
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
+ var __spreadValues = (a, b) => {
14
+ for (var prop in b || (b = {}))
15
+ if (__hasOwnProp.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
17
+ if (__getOwnPropSymbols)
18
+ for (var prop of __getOwnPropSymbols(b)) {
19
+ if (__propIsEnum.call(b, prop))
20
+ __defNormalProp(a, prop, b[prop]);
21
+ }
22
+ return a;
23
+ };
24
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
+ var __export = (target, all) => {
26
+ for (var name in all)
27
+ __defProp(target, name, { get: all[name], enumerable: true });
28
+ };
29
+ var __copyProps = (to, from, except, desc) => {
30
+ if (from && typeof from === "object" || typeof from === "function") {
31
+ for (let key of __getOwnPropNames(from))
32
+ if (!__hasOwnProp.call(to, key) && key !== except)
33
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
34
+ }
35
+ return to;
36
+ };
37
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
38
+ // If the importer is in node compatibility mode or this is not an ESM
39
+ // file that has been converted to a CommonJS file using a Babel-
40
+ // compatible transform (i.e. "__esModule" has not been set), then set
41
+ // "default" to the CommonJS "module.exports" for node compatibility.
42
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
43
+ mod
44
+ ));
45
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
46
+
47
+ // index.ts
48
+ var test_exports = {};
49
+ __export(test_exports, {
50
+ baseConfig: () => baseConfig,
51
+ getAppConfig: () => getAppConfig,
52
+ getPackageConfig: () => getPackageConfig,
53
+ getProjectConfig: () => getProjectConfig
54
+ });
55
+ module.exports = __toCommonJS(test_exports);
56
+ var import_jest = __toESM(require("next/jest"));
57
+ var createJestConfig = (0, import_jest.default)({
58
+ // Provide the path to your Next.js app to load next.config.js and .env files in your test environment
59
+ dir: "./"
60
+ });
61
+ var baseConfig = {
62
+ verbose: false,
63
+ silent: false,
64
+ testTimeout: process.env.CI ? 2e4 : 1e4,
65
+ // testEnvironment: 'jsdom',
66
+ testEnvironment: "jest-environment-jsdom",
67
+ // setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
68
+ reporters: ["default", "github-actions"],
69
+ /*
70
+ snapshotFormat: {
71
+ printBasicPrototype: false,
72
+ },
73
+ */
74
+ /*
75
+ coverageThreshold: {
76
+ global: {
77
+ branches: 80,
78
+ functions: 80,
79
+ lines: 80,
80
+ statements: 80,
81
+ }
82
+ },
83
+ */
84
+ coverageReporters: ["html", "text", "text-summary", "lcov"]
85
+ };
86
+ function getProjectConfig() {
87
+ const cwd = process.cwd();
88
+ const config = __spreadProps(__spreadValues({}, baseConfig), {
89
+ rootDir: ".",
90
+ roots: [
91
+ `${cwd}`
92
+ ],
93
+ resetMocks: true,
94
+ modulePaths: [
95
+ `${cwd}/src/`
96
+ ],
97
+ moduleDirectories: [
98
+ "node_modules"
99
+ ],
100
+ testMatch: [
101
+ "<rootDir>/src/**/*(?<!e2e).test.{js,jsx,ts,tsx}"
102
+ ],
103
+ coverageDirectory: `${cwd}/coverage`,
104
+ collectCoverageFrom: [
105
+ "<rootDir>/src/**/*(?<!test).{js,jsx,ts,tsx}"
106
+ ],
107
+ setupFilesAfterEnv: [`${cwd}/jest.setup.js`],
108
+ transform: {
109
+ "^.+\\.(ts|tsx)?$": ["@swc/jest", {
110
+ jsc: {
111
+ transform: {
112
+ react: {
113
+ runtime: "automatic"
114
+ }
115
+ }
116
+ }
117
+ }]
118
+ },
119
+ // Rewrite Swiper ESM imports as paths (allows them to be transformed w/o errors)
120
+ moduleNameMapper: {
121
+ "\\.(css|scss)$": "identity-obj-proxy",
122
+ "\\.(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",
123
+ // swiper
124
+ "swiper": "<rootDir>/node_modules/swiper/swiper-bundle.js",
125
+ "swiper/react": "<rootDir>/node_modules/swiper/react/swiper-react.js"
126
+ // 'swiper/css': '<rootDir>/node_modules/swiper/swiper.min.css',
127
+ // 'swiper/css/bundle': '<rootDir>/node_modules/swiper/swiper-bundle.min.css',
128
+ // 'swiper/css/autoplay': '<rootDir>/node_modules/swiper/modules/autoplay/autoplay.min.css',
129
+ // 'swiper/css/free-mode': '<rootDir>/node_modules/swiper/modules/autoplay/free-mode.min.css',
130
+ // 'swiper/css/navigation': '<rootDir>/node_modules/swiper/modules/autoplay/navigation.min.css',
131
+ // 'swiper/css/pagination': '<rootDir>/node_modules/swiper/modules/autoplay/pagination.min.css',
132
+ // Handle module aliases (this will be automatically configured for you soon)
133
+ // '^@/components/(.*)$': '<rootDir>/components/$1',
134
+ // '^@/pages/(.*)$': '<rootDir>/pages/$1',
135
+ },
136
+ transformIgnorePatterns: [
137
+ "node_modules",
138
+ "node_modules/(?!(swiper|swiper/react|ssr-window|dom7)/)"
139
+ ]
140
+ });
141
+ return config;
142
+ }
143
+ function getAppConfig() {
144
+ const config = getProjectConfig();
145
+ config.transform = {
146
+ "^.+\\.(ts|tsx)?$": ["@swc/jest", {
147
+ jsc: {
148
+ transform: {
149
+ react: {
150
+ runtime: "automatic"
151
+ }
152
+ }
153
+ },
154
+ tsconfig: "tsconfig.test.json"
155
+ }]
156
+ };
157
+ return createJestConfig(config);
158
+ }
159
+ function getPackageConfig() {
160
+ const cwd = process.cwd();
161
+ const config = __spreadProps(__spreadValues({}, baseConfig), {
162
+ rootDir: ".",
163
+ roots: [
164
+ `${cwd}`
165
+ ],
166
+ modulePaths: [
167
+ `${cwd}/src/`
168
+ ],
169
+ moduleDirectories: [
170
+ "node_modules"
171
+ ],
172
+ testMatch: [
173
+ "<rootDir>/src/**/*(?<!e2e).test.{js,jsx,ts,tsx}"
174
+ ],
175
+ coverageDirectory: `${cwd}/coverage`,
176
+ collectCoverageFrom: [
177
+ "<rootDir>/src/**/*(?<!test).{js,jsx,ts,tsx}"
178
+ ],
179
+ transform: {
180
+ "^.+\\.(ts|tsx)?$": ["@swc/jest", {
181
+ jsc: {
182
+ transform: {
183
+ react: {
184
+ runtime: "automatic"
185
+ }
186
+ }
187
+ }
188
+ }]
189
+ },
190
+ transformIgnorePatterns: ["node_modules"]
191
+ });
192
+ return config;
193
+ }
194
+ // Annotate the CommonJS export names for ESM import in node:
195
+ 0 && (module.exports = {
196
+ baseConfig,
197
+ getAppConfig,
198
+ getPackageConfig,
199
+ getProjectConfig
200
+ });
package/dist/index.mjs ADDED
@@ -0,0 +1,165 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+
21
+ // index.ts
22
+ import nextJest from "next/jest";
23
+ var createJestConfig = nextJest({
24
+ // Provide the path to your Next.js app to load next.config.js and .env files in your test environment
25
+ dir: "./"
26
+ });
27
+ var baseConfig = {
28
+ verbose: false,
29
+ silent: false,
30
+ testTimeout: process.env.CI ? 2e4 : 1e4,
31
+ // testEnvironment: 'jsdom',
32
+ testEnvironment: "jest-environment-jsdom",
33
+ // setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
34
+ reporters: ["default", "github-actions"],
35
+ /*
36
+ snapshotFormat: {
37
+ printBasicPrototype: false,
38
+ },
39
+ */
40
+ /*
41
+ coverageThreshold: {
42
+ global: {
43
+ branches: 80,
44
+ functions: 80,
45
+ lines: 80,
46
+ statements: 80,
47
+ }
48
+ },
49
+ */
50
+ coverageReporters: ["html", "text", "text-summary", "lcov"]
51
+ };
52
+ function getProjectConfig() {
53
+ const cwd = process.cwd();
54
+ const config = __spreadProps(__spreadValues({}, baseConfig), {
55
+ rootDir: ".",
56
+ roots: [
57
+ `${cwd}`
58
+ ],
59
+ resetMocks: true,
60
+ modulePaths: [
61
+ `${cwd}/src/`
62
+ ],
63
+ moduleDirectories: [
64
+ "node_modules"
65
+ ],
66
+ testMatch: [
67
+ "<rootDir>/src/**/*(?<!e2e).test.{js,jsx,ts,tsx}"
68
+ ],
69
+ coverageDirectory: `${cwd}/coverage`,
70
+ collectCoverageFrom: [
71
+ "<rootDir>/src/**/*(?<!test).{js,jsx,ts,tsx}"
72
+ ],
73
+ setupFilesAfterEnv: [`${cwd}/jest.setup.js`],
74
+ transform: {
75
+ "^.+\\.(ts|tsx)?$": ["@swc/jest", {
76
+ jsc: {
77
+ transform: {
78
+ react: {
79
+ runtime: "automatic"
80
+ }
81
+ }
82
+ }
83
+ }]
84
+ },
85
+ // Rewrite Swiper ESM imports as paths (allows them to be transformed w/o errors)
86
+ moduleNameMapper: {
87
+ "\\.(css|scss)$": "identity-obj-proxy",
88
+ "\\.(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",
89
+ // swiper
90
+ "swiper": "<rootDir>/node_modules/swiper/swiper-bundle.js",
91
+ "swiper/react": "<rootDir>/node_modules/swiper/react/swiper-react.js"
92
+ // 'swiper/css': '<rootDir>/node_modules/swiper/swiper.min.css',
93
+ // 'swiper/css/bundle': '<rootDir>/node_modules/swiper/swiper-bundle.min.css',
94
+ // 'swiper/css/autoplay': '<rootDir>/node_modules/swiper/modules/autoplay/autoplay.min.css',
95
+ // 'swiper/css/free-mode': '<rootDir>/node_modules/swiper/modules/autoplay/free-mode.min.css',
96
+ // 'swiper/css/navigation': '<rootDir>/node_modules/swiper/modules/autoplay/navigation.min.css',
97
+ // 'swiper/css/pagination': '<rootDir>/node_modules/swiper/modules/autoplay/pagination.min.css',
98
+ // Handle module aliases (this will be automatically configured for you soon)
99
+ // '^@/components/(.*)$': '<rootDir>/components/$1',
100
+ // '^@/pages/(.*)$': '<rootDir>/pages/$1',
101
+ },
102
+ transformIgnorePatterns: [
103
+ "node_modules",
104
+ "node_modules/(?!(swiper|swiper/react|ssr-window|dom7)/)"
105
+ ]
106
+ });
107
+ return config;
108
+ }
109
+ function getAppConfig() {
110
+ const config = getProjectConfig();
111
+ config.transform = {
112
+ "^.+\\.(ts|tsx)?$": ["@swc/jest", {
113
+ jsc: {
114
+ transform: {
115
+ react: {
116
+ runtime: "automatic"
117
+ }
118
+ }
119
+ },
120
+ tsconfig: "tsconfig.test.json"
121
+ }]
122
+ };
123
+ return createJestConfig(config);
124
+ }
125
+ function getPackageConfig() {
126
+ const cwd = process.cwd();
127
+ const config = __spreadProps(__spreadValues({}, baseConfig), {
128
+ rootDir: ".",
129
+ roots: [
130
+ `${cwd}`
131
+ ],
132
+ modulePaths: [
133
+ `${cwd}/src/`
134
+ ],
135
+ moduleDirectories: [
136
+ "node_modules"
137
+ ],
138
+ testMatch: [
139
+ "<rootDir>/src/**/*(?<!e2e).test.{js,jsx,ts,tsx}"
140
+ ],
141
+ coverageDirectory: `${cwd}/coverage`,
142
+ collectCoverageFrom: [
143
+ "<rootDir>/src/**/*(?<!test).{js,jsx,ts,tsx}"
144
+ ],
145
+ transform: {
146
+ "^.+\\.(ts|tsx)?$": ["@swc/jest", {
147
+ jsc: {
148
+ transform: {
149
+ react: {
150
+ runtime: "automatic"
151
+ }
152
+ }
153
+ }
154
+ }]
155
+ },
156
+ transformIgnorePatterns: ["node_modules"]
157
+ });
158
+ return config;
159
+ }
160
+ export {
161
+ baseConfig,
162
+ getAppConfig,
163
+ getPackageConfig,
164
+ getProjectConfig
165
+ };
package/package.json CHANGED
@@ -1,44 +1,54 @@
1
- {
2
- "name": "@websolutespa/test",
3
- "version": "0.0.1",
4
- "description": "",
5
- "keywords": [
6
- "bom",
7
- "test"
8
- ],
9
- "license": "MIT",
10
- "repository": {
11
- "type": "git",
12
- "url": "git://github.com/websolutespa/bom.git"
13
- },
14
- "main": "index.ts",
15
- "types": "index.ts",
16
- "sideEffects": false,
17
- "publishConfig": {
18
- "access": "public"
19
- },
20
- "scripts": {
21
- "lint": "eslint *.js*"
22
- },
23
- "dependencies": {
24
- "eslint-config-websolute": "*"
25
- },
26
- "devDependencies": {
27
- "@playwright/test": "^1.29.1",
28
- "@testing-library/dom": "^8.19.0",
29
- "@testing-library/jest-dom": "^5.16.5",
30
- "@testing-library/react": "^13.4.0",
31
- "@testing-library/user-event": "^14.4.3",
32
- "@types/jest": "^29.2.4",
33
- "identity-obj-proxy": "^3.0.0",
34
- "jest-environment-jsdom": "^29.3.1",
35
- "jest-fail-on-console": "^3.0.2",
36
- "jest-matcher-utils": "^29.3.1",
37
- "jest": "^29.3.1",
38
- "npm-run-all": "^4.1.5",
39
- "open-cli": "^7.1.0",
40
- "ts-node": "^10.9.1",
41
- "tsup": "^6.6.3",
42
- "typescript": "^4.8.2"
43
- }
44
- }
1
+ {
2
+ "name": "@websolutespa/test",
3
+ "version": "0.0.2",
4
+ "description": "",
5
+ "keywords": [
6
+ "bom",
7
+ "test"
8
+ ],
9
+ "license": "MIT",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git://github.com/websolutespa/bom.git"
13
+ },
14
+ "main": "./index.ts",
15
+ "types": "./index.ts",
16
+ "prepack": {
17
+ "types": "./dist/index.d.ts",
18
+ "main": "./dist/index.js"
19
+ },
20
+ "postpack": {
21
+ "types": "./index.ts",
22
+ "main": "./index.ts"
23
+ },
24
+ "sideEffects": false,
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "scripts": {
29
+ "build": "tsup ./index.ts --format esm,cjs --dts --external react",
30
+ "lint": "eslint *.js*"
31
+ },
32
+ "dependencies": {
33
+ "@playwright/test": "^1.29.1",
34
+ "@testing-library/dom": "^8.19.0",
35
+ "@testing-library/jest-dom": "^5.16.5",
36
+ "@testing-library/react": "^13.4.0",
37
+ "@testing-library/user-event": "^14.4.3",
38
+ "identity-obj-proxy": "^3.0.0",
39
+ "jest-environment-jsdom": "^29.3.1",
40
+ "jest-fail-on-console": "^3.0.2",
41
+ "jest-matcher-utils": "^29.3.1",
42
+ "jest": "^29.3.1",
43
+ "next": "^12.3.2"
44
+ },
45
+ "devDependencies": {
46
+ "@types/jest": "^29.2.4",
47
+ "eslint-config-websolute": "*",
48
+ "npm-run-all": "^4.1.5",
49
+ "open-cli": "^7.1.0",
50
+ "ts-node": "^10.9.1",
51
+ "tsup": "^6.6.3",
52
+ "typescript": "^4.8.2"
53
+ }
54
+ }
package/index.ts DELETED
@@ -1,149 +0,0 @@
1
- import { Config } from 'jest';
2
- import nextJest from 'next/jest';
3
-
4
- const createJestConfig = nextJest({
5
- // Provide the path to your Next.js app to load next.config.js and .env files in your test environment
6
- dir: './',
7
- });
8
-
9
- export const baseConfig: Config = {
10
- verbose: false,
11
- silent: false,
12
- testTimeout: process.env.CI ? 20000 : 10000,
13
- // testEnvironment: 'jsdom',
14
- testEnvironment: 'jest-environment-jsdom',
15
- // setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
16
- reporters: ['default', 'github-actions'],
17
- /*
18
- snapshotFormat: {
19
- printBasicPrototype: false,
20
- },
21
- */
22
- /*
23
- coverageThreshold: {
24
- global: {
25
- branches: 80,
26
- functions: 80,
27
- lines: 80,
28
- statements: 80,
29
- }
30
- },
31
- */
32
- coverageReporters: ['html', 'text', 'text-summary', 'lcov'],
33
- };
34
-
35
- export function getProjectConfig(): {} {
36
- const cwd = process.cwd();
37
- // console.log('getProjectConfig', 'process.cwd()', cwd);
38
- const config: Config = {
39
- ...baseConfig,
40
- rootDir: '.',
41
- roots: [
42
- `${cwd}`,
43
- ],
44
- resetMocks: true,
45
- modulePaths: [
46
- `${cwd}/src/`,
47
- ],
48
- moduleDirectories: [
49
- 'node_modules',
50
- ],
51
- testMatch: [
52
- '<rootDir>/src/**/*(?<!e2e).test.{js,jsx,ts,tsx}',
53
- ],
54
- coverageDirectory: `${cwd}/coverage`,
55
- collectCoverageFrom: [
56
- '<rootDir>/src/**/*(?<!test).{js,jsx,ts,tsx}',
57
- ],
58
- setupFilesAfterEnv: [`${cwd}/jest.setup.js`],
59
- transform: {
60
- '^.+\\.(ts|tsx)?$': ['@swc/jest', {
61
- jsc: {
62
- transform: {
63
- react: {
64
- runtime: 'automatic',
65
- },
66
- },
67
- },
68
- }]
69
- },
70
- // Rewrite Swiper ESM imports as paths (allows them to be transformed w/o errors)
71
- moduleNameMapper: {
72
- '\\.(css|scss)$': 'identity-obj-proxy',
73
- '\\.(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',
74
- // swiper
75
- 'swiper': '<rootDir>/node_modules/swiper/swiper-bundle.js',
76
- 'swiper/react': '<rootDir>/node_modules/swiper/react/swiper-react.js',
77
- // 'swiper/css': '<rootDir>/node_modules/swiper/swiper.min.css',
78
- // 'swiper/css/bundle': '<rootDir>/node_modules/swiper/swiper-bundle.min.css',
79
- // 'swiper/css/autoplay': '<rootDir>/node_modules/swiper/modules/autoplay/autoplay.min.css',
80
- // 'swiper/css/free-mode': '<rootDir>/node_modules/swiper/modules/autoplay/free-mode.min.css',
81
- // 'swiper/css/navigation': '<rootDir>/node_modules/swiper/modules/autoplay/navigation.min.css',
82
- // 'swiper/css/pagination': '<rootDir>/node_modules/swiper/modules/autoplay/pagination.min.css',
83
- // Handle module aliases (this will be automatically configured for you soon)
84
- // '^@/components/(.*)$': '<rootDir>/components/$1',
85
- // '^@/pages/(.*)$': '<rootDir>/pages/$1',
86
- },
87
- transformIgnorePatterns: [
88
- 'node_modules',
89
- 'node_modules/(?!(swiper|swiper/react|ssr-window|dom7)/)',
90
- ]
91
- };
92
- return config;
93
- }
94
-
95
- export function getAppConfig(): {} {
96
- const config: Config = getProjectConfig();
97
- config.transform = {
98
- '^.+\\.(ts|tsx)?$': ['@swc/jest', {
99
- jsc: {
100
- transform: {
101
- react: {
102
- runtime: 'automatic',
103
- },
104
- },
105
- },
106
- tsconfig: 'tsconfig.test.json'
107
- }]
108
- };
109
- return createJestConfig(config);
110
- }
111
-
112
- export function getPackageConfig(): {} {
113
- const cwd = process.cwd();
114
- // console.log('getPackageConfig', 'process.cwd()', cwd);
115
- const config: Config = {
116
- ...baseConfig,
117
- rootDir: '.',
118
- roots: [
119
- `${cwd}`,
120
- ],
121
- modulePaths: [
122
- `${cwd}/src/`,
123
- ],
124
- moduleDirectories: [
125
- 'node_modules',
126
- ],
127
- testMatch: [
128
- '<rootDir>/src/**/*(?<!e2e).test.{js,jsx,ts,tsx}',
129
- ],
130
- coverageDirectory: `${cwd}/coverage`,
131
- collectCoverageFrom: [
132
- '<rootDir>/src/**/*(?<!test).{js,jsx,ts,tsx}',
133
- ],
134
- transform: {
135
- '^.+\\.(ts|tsx)?$': ['@swc/jest', {
136
- jsc: {
137
- transform: {
138
- react: {
139
- runtime: 'automatic',
140
- },
141
- },
142
- },
143
- }]
144
- },
145
- transformIgnorePatterns: ['node_modules'],
146
- };
147
- // console.log('getPackageConfig', config);
148
- return config;
149
- }