Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwooding committed Aug 15, 2024
1 parent 51a96e9 commit 2269cdd
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"env": {
"test": {
"plugins": ["istanbul"]
}
}
}
14 changes: 11 additions & 3 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import installCoverageTask from "@cypress/code-coverage/task";
import { defineConfig } from "cypress";
import { devServer } from "cypress-rspack-dev-server";
import { version as reactVersion } from "react";
import { merge } from "webpack-merge";

export default defineConfig({
viewportWidth: 1280,
Expand All @@ -25,12 +27,18 @@ export default defineConfig({
return devServer({
...devServerConfig,
framework: "react",
rspackConfig: {
...require("./rspack.config").default,
rspackConfig: merge(require("./rspack.config").default, {
experiments: {
lazyCompilation: !devServerConfig.cypressConfig.isTextTerminal,
},
},
resolve: {
alias: {
"cypress/react18": reactVersion.startsWith("18")
? "cypress/react18"
: "cypress/react",
},
},
}),
});
},
specPattern: "packages/**/src/**/*.cy.{js,ts,jsx,tsx}",
Expand Down
4 changes: 4 additions & 0 deletions rspack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ 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[\\/]/],
Expand Down
8 changes: 8 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5949,6 +5949,7 @@ __metadata:
sass: "npm:^1.52.3"
storybook: "npm:^8.2.4"
stylelint: "npm:^16.0.0"
swc-plugin-coverage-instrument: "npm:^0.0.24"
typescript: "npm:4.6.4"
vite: "npm:^4.4.9"
vite-plugin-istanbul: "npm:^6.0.0"
Expand Down Expand Up @@ -27582,6 +27583,13 @@ __metadata:
languageName: node
linkType: hard

"swc-plugin-coverage-instrument@npm:^0.0.24":
version: 0.0.24
resolution: "swc-plugin-coverage-instrument@npm:0.0.24"
checksum: 10/7eeb04408430d79ee8ec7a628955e7680d62c89f49a002fa482e5bed73c0d01fa8d262303ff93a6e3efdae7667b1eaa984a4b07aa32b56f48d7e154a3645de97
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 2269cdd

Please sign in to comment.