@elliemae/pui-cli 6.0.0-beta.25 → 6.0.0-beta.26
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/lib/cli-commands/test.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
const { exit } = require('yargs');
|
|
2
2
|
const { exec, logError, logSuccess } = require('./utils');
|
|
3
|
-
// const { lintCSS, lintJS } = require('./lint');
|
|
4
3
|
|
|
5
4
|
const { CI = false } = process.env;
|
|
6
5
|
|
|
@@ -21,18 +20,10 @@ async function handler(argv) {
|
|
|
21
20
|
if (argv.r) commandOptions += ' --bail --findRelatedTests';
|
|
22
21
|
if (argv.s) commandOptions += ' --silent';
|
|
23
22
|
try {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
// logSuccess('Linting completed');
|
|
29
|
-
// } catch (err) {
|
|
30
|
-
// logError('Linting failed');
|
|
31
|
-
// exit(-1, err);
|
|
32
|
-
// return -1;
|
|
33
|
-
// }
|
|
34
|
-
// }
|
|
35
|
-
await exec('rimraf ./reports');
|
|
23
|
+
if (CI) {
|
|
24
|
+
await exec('rimraf ./reports');
|
|
25
|
+
}
|
|
26
|
+
|
|
36
27
|
// eslint-disable-next-line jest/valid-title, jest/no-disabled-tests, jest/expect-expect
|
|
37
28
|
await test(commandOptions);
|
|
38
29
|
logSuccess('Unit test execution completed');
|
|
@@ -74,7 +74,7 @@ const jestConfig = {
|
|
|
74
74
|
testRegex: '(app|lib).*/tests/.*\\.test\\.[jt]sx?$',
|
|
75
75
|
snapshotSerializers: [],
|
|
76
76
|
testResultsProcessor: 'jest-sonar-reporter',
|
|
77
|
-
resolver: '
|
|
77
|
+
resolver: path.resolve(__dirname, './resolver.js'),
|
|
78
78
|
transform: {
|
|
79
79
|
'^.+\\.[jt]sx?$': [
|
|
80
80
|
'esbuild-jest',
|
|
@@ -84,7 +84,7 @@ const jestConfig = {
|
|
|
84
84
|
],
|
|
85
85
|
},
|
|
86
86
|
transformIgnorePatterns: [
|
|
87
|
-
'node_modules/(?!(@elliemae/pui-cli/
|
|
87
|
+
'node_modules/(?!(@elliemae/em-platform-document-viewer|@elliemae/pui-cli|@elliemae/pui-app-widgets|lodash-es|react-spring|react-select|react-dates|@babel/runtime)/)',
|
|
88
88
|
],
|
|
89
89
|
globals: {
|
|
90
90
|
APP_CONFIG: getAppConfig(),
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const resolutions = [
|
|
2
|
+
{
|
|
3
|
+
matcher: /\.jsx?$/i,
|
|
4
|
+
extensions: ['.tsx', '.ts'],
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
matcher: /\.mjs$/i,
|
|
8
|
+
extensions: ['.mts'],
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
matcher: /\.cjs$/i,
|
|
12
|
+
extensions: ['.cts'],
|
|
13
|
+
},
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
const importResolver = require('enhanced-resolve').create.sync({
|
|
17
|
+
conditionNames: ['import', 'node', 'default'],
|
|
18
|
+
extensions: ['.js', '.jsx', '.json', '.node', '.ts', '.tsx'],
|
|
19
|
+
});
|
|
20
|
+
const requireResolver = require('enhanced-resolve').create.sync({
|
|
21
|
+
conditionNames: ['require', 'node', 'default'],
|
|
22
|
+
extensions: ['.js', '.jsx', '.json', '.node', '.ts', '.tsx'],
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
module.exports = (request, options) => {
|
|
26
|
+
let resolver = requireResolver;
|
|
27
|
+
if (options.conditions?.includes('import')) {
|
|
28
|
+
resolver = importResolver;
|
|
29
|
+
}
|
|
30
|
+
const resolution = resolutions.find(({ matcher }) => matcher.test(request));
|
|
31
|
+
if (resolution) {
|
|
32
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
33
|
+
for (const extension of resolution.extensions) {
|
|
34
|
+
try {
|
|
35
|
+
return resolver(
|
|
36
|
+
options.basedir,
|
|
37
|
+
request.replace(resolution.matcher, extension),
|
|
38
|
+
);
|
|
39
|
+
// eslint-disable-next-line no-empty
|
|
40
|
+
} catch {}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return resolver(options.basedir, request);
|
|
44
|
+
};
|
|
@@ -8,6 +8,29 @@ import ResizeObserver from 'resize-observer-polyfill';
|
|
|
8
8
|
import addMatchMedia from './mocks/matchMedia.js';
|
|
9
9
|
import { logger } from './mocks/pui-diagnostics.js';
|
|
10
10
|
|
|
11
|
+
// eslint-disable-next-line no-console
|
|
12
|
+
const originalError = console.error;
|
|
13
|
+
// eslint-disable-next-line no-console
|
|
14
|
+
console.error = (...args) => {
|
|
15
|
+
const ignoreList = [
|
|
16
|
+
`Warning: Can't perform a React state update on an unmounted component`,
|
|
17
|
+
`Warning: Function components cannot be given refs`,
|
|
18
|
+
`Warning: Failed %s type:`,
|
|
19
|
+
`Warning: Invalid DOM property`,
|
|
20
|
+
`Warning: Each child in a list should have a unique`,
|
|
21
|
+
'Warning: Received `%s` for a non-boolean attribute',
|
|
22
|
+
'Warning: <%s /> is using incorrect casing.',
|
|
23
|
+
'Warning: The tag <%s> is unrecognized in this browser',
|
|
24
|
+
];
|
|
25
|
+
if (
|
|
26
|
+
ignoreList.find(
|
|
27
|
+
(ignoreMsg) => !!args.find((arg) => arg.includes?.(ignoreMsg)),
|
|
28
|
+
)
|
|
29
|
+
)
|
|
30
|
+
return false;
|
|
31
|
+
return originalError(...args);
|
|
32
|
+
};
|
|
33
|
+
|
|
11
34
|
if (expect) expect.extend(jestAxe.toHaveNoViolations);
|
|
12
35
|
jest.setTimeout(60000);
|
|
13
36
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/pui-cli",
|
|
3
|
-
"version": "6.0.0-beta.
|
|
3
|
+
"version": "6.0.0-beta.26",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "ICE MT UI Platform CLI",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -125,6 +125,7 @@
|
|
|
125
125
|
"dotenv": "~10.0.0",
|
|
126
126
|
"dotenv-webpack": "~7.0.3",
|
|
127
127
|
"duplicate-package-checker-webpack-plugin": "~3.0.0",
|
|
128
|
+
"enhanced-resolve": "~5.8.3",
|
|
128
129
|
"esbuild": "~0.14.2",
|
|
129
130
|
"esbuild-jest": "~0.5.0",
|
|
130
131
|
"esbuild-loader": "~2.16.0",
|
|
@@ -148,7 +149,7 @@
|
|
|
148
149
|
"eslint-plugin-prettier": "~4.0.0",
|
|
149
150
|
"eslint-plugin-react": "~7.27.1",
|
|
150
151
|
"eslint-plugin-react-hooks": "~4.3.0",
|
|
151
|
-
"eslint-plugin-redux-saga": "~1.2.
|
|
152
|
+
"eslint-plugin-redux-saga": "~1.2.2",
|
|
152
153
|
"eslint-plugin-storybook": "~0.5.3",
|
|
153
154
|
"eslint-plugin-testing-library": "~5.0.1",
|
|
154
155
|
"eslint-plugin-wdio": "~7.4.2",
|
|
@@ -179,7 +180,7 @@
|
|
|
179
180
|
"minimist": "~1.2.5",
|
|
180
181
|
"moment": "~2.29.1",
|
|
181
182
|
"moment-locales-webpack-plugin": "~1.2.0",
|
|
182
|
-
"msw": "~0.36.
|
|
183
|
+
"msw": "~0.36.2",
|
|
183
184
|
"node-gyp": "~8.4.1",
|
|
184
185
|
"node-plop": "~0.30.0",
|
|
185
186
|
"nodemon": "~2.0.15",
|
|
@@ -188,7 +189,7 @@
|
|
|
188
189
|
"pino": "~7.5.1",
|
|
189
190
|
"pino-pretty": "~7.2.0",
|
|
190
191
|
"pinst": "~2.1.6",
|
|
191
|
-
"plop": "~3.0.
|
|
192
|
+
"plop": "~3.0.3",
|
|
192
193
|
"postcss": "~8.4.4",
|
|
193
194
|
"postcss-jsx": "~0.36.4",
|
|
194
195
|
"postcss-html": "~1.3.0",
|
|
@@ -211,8 +212,8 @@
|
|
|
211
212
|
"script-loader": "~0.7.2",
|
|
212
213
|
"semantic-release": "~18.0.1",
|
|
213
214
|
"shelljs": "~0.8.4",
|
|
214
|
-
"slackify-markdown": "~4.3.
|
|
215
|
-
"storybook-builder-vite": "~0.1.
|
|
215
|
+
"slackify-markdown": "~4.3.1",
|
|
216
|
+
"storybook-builder-vite": "~0.1.11",
|
|
216
217
|
"storybook-addon-turbo-build": "~1.0.1",
|
|
217
218
|
"storybook-react-router": "~1.0.8",
|
|
218
219
|
"style-loader": "~3.3.1",
|
|
@@ -224,7 +225,6 @@
|
|
|
224
225
|
"svg-url-loader": "~7.1.1",
|
|
225
226
|
"svgo": "~2.8.0",
|
|
226
227
|
"terser-webpack-plugin": "~5.2.5",
|
|
227
|
-
"ts-jest-resolver": "~2.0.0",
|
|
228
228
|
"ts-node": "~10.4.0",
|
|
229
229
|
"tsc-alias": "~1.4.2",
|
|
230
230
|
"tsc-files": "~1.1.3",
|
|
@@ -235,7 +235,7 @@
|
|
|
235
235
|
"update-notifier": "~5.1.0",
|
|
236
236
|
"url-loader": "~4.1.1",
|
|
237
237
|
"uuid": "~8.3.2",
|
|
238
|
-
"vite": "~2.
|
|
238
|
+
"vite": "~2.7.1",
|
|
239
239
|
"webpack": "~5.65.0",
|
|
240
240
|
"webpack-bundle-analyzer": "~4.5.0",
|
|
241
241
|
"webpack-cli": "~4.9.1",
|