Skip to content

Commit

Permalink
Try coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwooding committed Nov 11, 2024
1 parent dc77771 commit e5c19d0
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 106 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,8 @@ jobs:
with:
name: cypress-screenshots
path: cypress/screenshots
- uses: actions/upload-artifact@v4
if: success() && ${{ matrix.react == '18' }}
with:
name: coverage
path: cypress/screenshots
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ storybook-static
# misc
.DS_Store
.eslintcache
.swc

npm-debug.log*
yarn-debug.log*
Expand Down
4 changes: 2 additions & 2 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import installCoverageTask from "@cypress/code-coverage/task";
// @ts-ignore
import { defineConfig } from "cypress";
import { devServer } from "cypress-rspack-dev-server";
import { merge } from "webpack-merge";
// import installCoverageTask from "@cypress/code-coverage/task";

export default defineConfig({
viewportWidth: 1280,
viewportHeight: 1024,
video: false,
component: {
setupNodeEvents(on, config) {
// installCoverageTask(on, config);
installCoverageTask(on, config);
//Setting up a log task to allow logging to the console during an axe test because console.log() does not work directly in a test
on("task", {
log(message: string) {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"copy:icon:css": "yarn workspace @salt-ds/icons copy:css",
"copy:countries:css": "yarn workspace @salt-ds/countries copy:css",
"test": "vitest",
"test:components": "CYPRESS_NO_COMMAND_LOG=1 cypress run --component --browser chrome",
"test:components": "cypress run --component --browser chrome",
"test:components:local": "cypress open --component --browser electron",
"prettier": "prettier --write .",
"prettier:ci": "prettier --check .",
Expand Down Expand Up @@ -81,7 +81,6 @@
"ag-grid-enterprise": "^31.3.4",
"ag-grid-react": "^31.3.4",
"axe-core": "^4.9.0",
"babel-loader": "^9.1.3",
"chromatic": "^11.10.1",
"ci-info": "^4.0.0",
"clsx": "^2.0.0",
Expand All @@ -104,6 +103,7 @@
"storybook": "^8.3.0",
"style-loader": "^4.0.0",
"stylelint": "^16.0.0",
"swc-plugin-coverage-instrument": "^0.0.25",
"typescript": "4.6.4",
"vite": "^5.0.0",
"vite-plugin-istanbul": "^6.0.0",
Expand Down
10 changes: 6 additions & 4 deletions rspack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,15 @@ export default defineConfig({
test: /\.css$/,
use: ["style-loader", "css-loader", "postcss-loader"],
},
{
test: /packages\/.*\/src\/.*\.[tj]sx?$/,
use: ["babel-loader"],
},
{
test: /\.(j|t)s$/,
exclude: [/[\\/]node_modules[\\/]/],
loader: "builtin:swc-loader",
options: {
jsc: {
experimental: {
plugins: [["swc-plugin-coverage-instrument", {}]],
},
parser: {
syntax: "typescript",
},
Expand All @@ -46,6 +45,9 @@ export default defineConfig({
exclude: [/[\\/]node_modules[\\/]/],
options: {
jsc: {
experimental: {
plugins: [["swc-plugin-coverage-instrument", {}]],
},
parser: {
syntax: "typescript",
tsx: true,
Expand Down
113 changes: 15 additions & 98 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3752,7 +3752,6 @@ __metadata:
ag-grid-enterprise: "npm:^31.3.4"
ag-grid-react: "npm:^31.3.4"
axe-core: "npm:^4.9.0"
babel-loader: "npm:^9.1.3"
browserslist-to-esbuild: "npm:^2.1.1"
chromatic: "npm:^11.10.1"
ci-info: "npm:^4.0.0"
Expand Down Expand Up @@ -3781,6 +3780,7 @@ __metadata:
storybook: "npm:^8.3.0"
style-loader: "npm:^4.0.0"
stylelint: "npm:^16.0.0"
swc-plugin-coverage-instrument: "npm:^0.0.25"
typescript: "npm:4.6.4"
vite: "npm:^5.0.0"
vite-plugin-istanbul: "npm:^6.0.0"
Expand Down Expand Up @@ -6895,19 +6895,6 @@ __metadata:
languageName: node
linkType: hard

"babel-loader@npm:^9.1.3":
version: 9.1.3
resolution: "babel-loader@npm:9.1.3"
dependencies:
find-cache-dir: "npm:^4.0.0"
schema-utils: "npm:^4.0.0"
peerDependencies:
"@babel/core": ^7.12.0
webpack: ">=5"
checksum: 10/7086e678273b5d1261141dca84ed784caab9f7921c8c24d7278c8ee3088235a9a9fd85caac9f0fa687336cb3c27248ca22dbf431469769b1b995d55aec606992
languageName: node
linkType: hard

"bail@npm:^2.0.0":
version: 2.0.2
resolution: "bail@npm:2.0.2"
Expand Down Expand Up @@ -7760,13 +7747,6 @@ __metadata:
languageName: node
linkType: hard

"common-path-prefix@npm:^3.0.0":
version: 3.0.0
resolution: "common-path-prefix@npm:3.0.0"
checksum: 10/09c180e8d8495d42990d617f4d4b7522b5da20f6b236afe310192d401d1da8147a7835ae1ea37797ba0c2238ef3d06f3492151591451df34539fdb4b2630f2b3
languageName: node
linkType: hard

"common-tags@npm:^1.8.0":
version: 1.8.2
resolution: "common-tags@npm:1.8.2"
Expand Down Expand Up @@ -10167,16 +10147,6 @@ __metadata:
languageName: node
linkType: hard

"find-cache-dir@npm:^4.0.0":
version: 4.0.0
resolution: "find-cache-dir@npm:4.0.0"
dependencies:
common-path-prefix: "npm:^3.0.0"
pkg-dir: "npm:^7.0.0"
checksum: 10/52a456a80deeb27daa3af6e06059b63bdb9cc4af4d845fc6d6229887e505ba913cd56000349caa60bc3aa59dacdb5b4c37903d4ba34c75102d83cab330b70d2f
languageName: node
linkType: hard

"find-my-way@npm:^7.7.0":
version: 7.7.0
resolution: "find-my-way@npm:7.7.0"
Expand All @@ -10188,7 +10158,7 @@ __metadata:
languageName: node
linkType: hard

"find-up@npm:6.3.0, find-up@npm:^6.3.0":
"find-up@npm:6.3.0":
version: 6.3.0
resolution: "find-up@npm:6.3.0"
dependencies:
Expand Down Expand Up @@ -15276,14 +15246,7 @@ __metadata:
languageName: node
linkType: hard

"picocolors@npm:^1.0.0, picocolors@npm:^1.0.1, picocolors@npm:^1.1.0":
version: 1.1.0
resolution: "picocolors@npm:1.1.0"
checksum: 10/a2ad60d94d185c30f2a140b19c512547713fb89b920d32cc6cf658fa786d63a37ba7b8451872c3d9fc34883971fb6e5878e07a20b60506e0bb2554dce9169ccb
languageName: node
linkType: hard

"picocolors@npm:^1.1.1":
"picocolors@npm:^1.0.0, picocolors@npm:^1.0.1, picocolors@npm:^1.1.1":
version: 1.1.1
resolution: "picocolors@npm:1.1.1"
checksum: 10/e1cf46bf84886c79055fdfa9dcb3e4711ad259949e3565154b004b260cd356c5d54b31a1437ce9782624bf766272fe6b0154f5f0c744fb7af5d454d2b60db045
Expand Down Expand Up @@ -15379,15 +15342,6 @@ __metadata:
languageName: node
linkType: hard

"pkg-dir@npm:^7.0.0":
version: 7.0.0
resolution: "pkg-dir@npm:7.0.0"
dependencies:
find-up: "npm:^6.3.0"
checksum: 10/94298b20a446bfbbd66604474de8a0cdd3b8d251225170970f15d9646f633e056c80520dd5b4c1d1050c9fed8f6a9e5054b141c93806439452efe72e57562c03
languageName: node
linkType: hard

"pluralize@npm:^8.0.0":
version: 8.0.0
resolution: "pluralize@npm:8.0.0"
Expand Down Expand Up @@ -15587,16 +15541,7 @@ __metadata:
languageName: node
linkType: hard

"postcss-modules-extract-imports@npm:^3.0.0":
version: 3.0.0
resolution: "postcss-modules-extract-imports@npm:3.0.0"
peerDependencies:
postcss: ^8.1.0
checksum: 10/8d68bb735cef4d43f9cdc1053581e6c1c864860b77fcfb670372b39c5feeee018dc5ddb2be4b07fef9bcd601edded4262418bbaeaf1bd4af744446300cebe358
languageName: node
linkType: hard

"postcss-modules-extract-imports@npm:^3.1.0":
"postcss-modules-extract-imports@npm:^3.0.0, postcss-modules-extract-imports@npm:^3.1.0":
version: 3.1.0
resolution: "postcss-modules-extract-imports@npm:3.1.0"
peerDependencies:
Expand All @@ -15605,20 +15550,7 @@ __metadata:
languageName: node
linkType: hard

"postcss-modules-local-by-default@npm:^4.0.0":
version: 4.0.0
resolution: "postcss-modules-local-by-default@npm:4.0.0"
dependencies:
icss-utils: "npm:^5.0.0"
postcss-selector-parser: "npm:^6.0.2"
postcss-value-parser: "npm:^4.1.0"
peerDependencies:
postcss: ^8.1.0
checksum: 10/94670d17bdc545ef4054724224597cb321fdf6086de56ecf6b7f809d0fb6f63d493badd5856cb05122bbc81a5a6684b4e15bc7686004ac3097c0ea916f57dad2
languageName: node
linkType: hard

"postcss-modules-local-by-default@npm:^4.0.5":
"postcss-modules-local-by-default@npm:^4.0.0, postcss-modules-local-by-default@npm:^4.0.5":
version: 4.1.0
resolution: "postcss-modules-local-by-default@npm:4.1.0"
dependencies:
Expand All @@ -15631,18 +15563,7 @@ __metadata:
languageName: node
linkType: hard

"postcss-modules-scope@npm:^3.0.0":
version: 3.0.0
resolution: "postcss-modules-scope@npm:3.0.0"
dependencies:
postcss-selector-parser: "npm:^6.0.4"
peerDependencies:
postcss: ^8.1.0
checksum: 10/cc36b8111c6160a1c21ca0e82de9daf0147be95f3b5403aedd83bcaee44ee425cb62b77f677fc53d0c8d51f7981018c1c8f0a4ad3d6f0138b09326ac48c2b297
languageName: node
linkType: hard

"postcss-modules-scope@npm:^3.2.0":
"postcss-modules-scope@npm:^3.0.0, postcss-modules-scope@npm:^3.2.0":
version: 3.2.1
resolution: "postcss-modules-scope@npm:3.2.1"
dependencies:
Expand Down Expand Up @@ -15832,7 +15753,7 @@ __metadata:
languageName: node
linkType: hard

"postcss-selector-parser@npm:^6.0.13, postcss-selector-parser@npm:^6.0.2, postcss-selector-parser@npm:^6.0.4, postcss-selector-parser@npm:^6.0.5, postcss-selector-parser@npm:^6.0.9":
"postcss-selector-parser@npm:^6.0.13, postcss-selector-parser@npm:^6.0.4, postcss-selector-parser@npm:^6.0.5, postcss-selector-parser@npm:^6.0.9":
version: 6.0.13
resolution: "postcss-selector-parser@npm:6.0.13"
dependencies:
Expand Down Expand Up @@ -15893,18 +15814,7 @@ __metadata:
languageName: node
linkType: hard

"postcss@npm:^8.4.32, postcss@npm:^8.4.43":
version: 8.4.47
resolution: "postcss@npm:8.4.47"
dependencies:
nanoid: "npm:^3.3.7"
picocolors: "npm:^1.1.0"
source-map-js: "npm:^1.2.1"
checksum: 10/f2b50ba9b6fcb795232b6bb20de7cdc538c0025989a8ed9c4438d1960196ba3b7eaff41fdb1a5c701b3504651ea87aeb685577707f0ae4d6ce6f3eae5df79a81
languageName: node
linkType: hard

"postcss@npm:^8.4.33":
"postcss@npm:^8.4.32, postcss@npm:^8.4.33, postcss@npm:^8.4.43":
version: 8.4.49
resolution: "postcss@npm:8.4.49"
dependencies:
Expand Down Expand Up @@ -18590,6 +18500,13 @@ __metadata:
languageName: node
linkType: hard

"swc-plugin-coverage-instrument@npm:^0.0.25":
version: 0.0.25
resolution: "swc-plugin-coverage-instrument@npm:0.0.25"
checksum: 10/110cf8074a2932c9cc370dbd833db4b71dca5a386ab13ca1116811fcf3be5498f98ab755cdf7395cf19cdd0da711119ac3edc9ab3c8bc26e50ca60ca07ae834d
languageName: node
linkType: hard

"swr@npm:^2.1.2":
version: 2.1.5
resolution: "swr@npm:2.1.5"
Expand Down

0 comments on commit e5c19d0

Please sign in to comment.