Reduce the webview test output

This commit is contained in:
Matt Rubens
2025-01-12 12:08:24 -05:00
parent 4c292abf7a
commit 2d176e5c92
3 changed files with 77 additions and 12 deletions

View File

@@ -0,0 +1,22 @@
const { override } = require('customize-cra');
module.exports = override();
// Jest configuration override
module.exports.jest = function(config) {
// Configure reporters
config.reporters = [["jest-simple-dot-reporter", {}]];
// Configure module name mapper for CSS modules
config.moduleNameMapper = {
...config.moduleNameMapper,
"\\.(css|less|scss|sass)$": "identity-obj-proxy"
};
// Configure transform ignore patterns for ES modules
config.transformIgnorePatterns = [
'/node_modules/(?!(rehype-highlight|react-remark|unist-util-visit|unist-util-find-after|vfile|unified|bail|is-plain-obj|trough|vfile-message|unist-util-stringify-position|mdast-util-from-markdown|mdast-util-to-string|micromark|decode-named-character-reference|character-entities|markdown-table|zwitch|longest-streak|escape-string-regexp|unist-util-is|hast-util-to-text|@vscode/webview-ui-toolkit|@microsoft/fast-react-wrapper|@microsoft/fast-element|@microsoft/fast-foundation|@microsoft/fast-web-utilities|exenv-es6)/)'
];
return config;
}

View File

@@ -37,7 +37,10 @@
"@babel/plugin-proposal-private-property-in-object": "^7.21.11", "@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@types/shell-quote": "^1.7.5", "@types/shell-quote": "^1.7.5",
"@types/vscode-webview": "^1.57.5", "@types/vscode-webview": "^1.57.5",
"eslint": "^8.57.0" "customize-cra": "^1.0.0",
"eslint": "^8.57.0",
"jest-simple-dot-reporter": "^1.0.5",
"react-app-rewired": "^2.2.1"
} }
}, },
"node_modules/@adobe/css-tools": { "node_modules/@adobe/css-tools": {
@@ -5624,6 +5627,15 @@
"version": "3.1.3", "version": "3.1.3",
"license": "MIT" "license": "MIT"
}, },
"node_modules/customize-cra": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/customize-cra/-/customize-cra-1.0.0.tgz",
"integrity": "sha512-DbtaLuy59224U+xCiukkxSq8clq++MOtJ1Et7LED1fLszWe88EoblEYFBJ895sB1mC6B4uu3xPT/IjClELhMbA==",
"dev": true,
"dependencies": {
"lodash.flow": "^3.5.0"
}
},
"node_modules/damerau-levenshtein": { "node_modules/damerau-levenshtein": {
"version": "1.0.8", "version": "1.0.8",
"license": "BSD-2-Clause" "license": "BSD-2-Clause"
@@ -9257,6 +9269,12 @@
"node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0"
} }
}, },
"node_modules/jest-simple-dot-reporter": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/jest-simple-dot-reporter/-/jest-simple-dot-reporter-1.0.5.tgz",
"integrity": "sha512-cZLFG/C7k0+WYoIGGuGXKm0vmJiXlWG/m3uCZ4RaMPYxt8lxjdXMLHYkxXaQ7gVWaSPe7uAPCEUcRxthC5xskg==",
"dev": true
},
"node_modules/jest-snapshot": { "node_modules/jest-snapshot": {
"version": "27.5.1", "version": "27.5.1",
"license": "MIT", "license": "MIT",
@@ -9896,6 +9914,12 @@
"version": "4.0.8", "version": "4.0.8",
"license": "MIT" "license": "MIT"
}, },
"node_modules/lodash.flow": {
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/lodash.flow/-/lodash.flow-3.5.0.tgz",
"integrity": "sha512-ff3BX/tSioo+XojX4MOsOMhJw0nZoUEF011LX8g8d3gvjVbxd89cCio4BCXronjxcTUIJUoqKEUA+n4CqvvRPw==",
"dev": true
},
"node_modules/lodash.memoize": { "node_modules/lodash.memoize": {
"version": "4.1.2", "version": "4.1.2",
"license": "MIT" "license": "MIT"
@@ -12269,6 +12293,30 @@
"version": "0.13.11", "version": "0.13.11",
"license": "MIT" "license": "MIT"
}, },
"node_modules/react-app-rewired": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/react-app-rewired/-/react-app-rewired-2.2.1.tgz",
"integrity": "sha512-uFQWTErXeLDrMzOJHKp0h8P1z0LV9HzPGsJ6adOtGlA/B9WfT6Shh4j2tLTTGlXOfiVx6w6iWpp7SOC5pvk+gA==",
"dev": true,
"dependencies": {
"semver": "^5.6.0"
},
"bin": {
"react-app-rewired": "bin/index.js"
},
"peerDependencies": {
"react-scripts": ">=2.1.3"
}
},
"node_modules/react-app-rewired/node_modules/semver": {
"version": "5.7.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
"integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
"dev": true,
"bin": {
"semver": "bin/semver"
}
},
"node_modules/react-dev-utils": { "node_modules/react-dev-utils": {
"version": "12.0.1", "version": "12.0.1",
"license": "MIT", "license": "MIT",

View File

@@ -29,9 +29,9 @@
"web-vitals": "^2.1.4" "web-vitals": "^2.1.4"
}, },
"scripts": { "scripts": {
"start": "react-scripts start", "start": "react-app-rewired start",
"build": "node ./scripts/build-react-no-split.js", "build": "node ./scripts/build-react-no-split.js",
"test": "react-scripts test --watchAll=false", "test": "react-app-rewired test --watchAll=false",
"eject": "react-scripts eject", "eject": "react-scripts eject",
"lint": "eslint src --ext ts,tsx" "lint": "eslint src --ext ts,tsx"
}, },
@@ -57,14 +57,9 @@
"@babel/plugin-proposal-private-property-in-object": "^7.21.11", "@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@types/shell-quote": "^1.7.5", "@types/shell-quote": "^1.7.5",
"@types/vscode-webview": "^1.57.5", "@types/vscode-webview": "^1.57.5",
"eslint": "^8.57.0" "customize-cra": "^1.0.0",
}, "eslint": "^8.57.0",
"jest": { "jest-simple-dot-reporter": "^1.0.5",
"transformIgnorePatterns": [ "react-app-rewired": "^2.2.1"
"/node_modules/(?!(rehype-highlight|react-remark|unist-util-visit|unist-util-find-after|vfile|unified|bail|is-plain-obj|trough|vfile-message|unist-util-stringify-position|mdast-util-from-markdown|mdast-util-to-string|micromark|decode-named-character-reference|character-entities|markdown-table|zwitch|longest-streak|escape-string-regexp|unist-util-is|hast-util-to-text|@vscode/webview-ui-toolkit|@microsoft/fast-react-wrapper|@microsoft/fast-element|@microsoft/fast-foundation|@microsoft/fast-web-utilities|exenv-es6)/)"
],
"moduleNameMapper": {
"\\.(css|less|scss|sass)$": "identity-obj-proxy"
}
} }
} }