Skip to content

Commit

Permalink
fix components tests by converting ts-jest to jest with babel
Browse files Browse the repository at this point in the history
  • Loading branch information
berekuk committed Jan 19, 2024
1 parent cd849a1 commit 0c3e049
Show file tree
Hide file tree
Showing 4 changed files with 223 additions and 71 deletions.
7 changes: 7 additions & 0 deletions packages/components/babel.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
presets: [
["@babel/preset-env", { targets: { node: "current" } }],
"@babel/preset-typescript",
["@babel/preset-react", { runtime: "automatic" }],
],
};
13 changes: 2 additions & 11 deletions packages/components/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
/** @type {import('jest').Config} */
const jestConfig = {
preset: "ts-jest/presets/default-esm-legacy",
testEnvironment: "jsdom",
extensionsToTreatAsEsm: [".ts", ".tsx"],
setupFilesAfterEnv: ["<rootDir>/test/setup.ts"],
moduleNameMapper: {
"^(\\.{1,2}/.*)\\.js$": "$1",
},
transform: {
"^.+\\.tsx?$": [
"ts-jest",
{
useESM: true,
tsconfig: "tsconfig.tests.json",
},
],
},
testPathIgnorePatterns: ["<rootDir>/node_modules/", "<rootDir>/dist"],
};

Expand Down
8 changes: 5 additions & 3 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"@hookform/resolvers": "^3.3.3",
"@lezer/common": "^1.2.0",
"@quri/prettier-plugin-squiggle": "workspace:*",
"@quri/squiggle-textmate-grammar": "workspace:*",
"@quri/squiggle-lang": "workspace:*",
"@quri/squiggle-textmate-grammar": "workspace:*",
"@quri/ui": "workspace:*",
"@react-hook/size": "^2.1.2",
"@tailwindcss/typography": "^0.5.10",
Expand All @@ -45,12 +45,14 @@
"zod": "^3.22.4"
},
"devDependencies": {
"@quri/configs": "workspace:*",
"@babel/preset-react": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"@jest/globals": "^29.7.0",
"@juggle/resize-observer": "^3.4.0",
"@lezer/generator": "^1.5.1",
"@lezer/highlight": "^1.2.0",
"@lezer/lr": "^1.3.14",
"@quri/configs": "workspace:*",
"@storybook/addon-actions": "^7.6.6",
"@storybook/addon-docs": "^7.6.6",
"@storybook/addon-essentials": "^7.6.6",
Expand All @@ -73,6 +75,7 @@
"@typescript-eslint/eslint-plugin": "^6.16.0",
"@typescript-eslint/parser": "^6.16.0",
"@wogns3623/eslint-plugin-better-exhaustive-deps": "^1.1.0",
"babel-jest": "^29.7.0",
"canvas": "^2.11.2",
"eslint": "^8.56.0",
"eslint-plugin-react": "^7.33.2",
Expand All @@ -88,7 +91,6 @@
"rollup-plugin-node-builtins": "^2.1.2",
"storybook": "^7.6.7",
"tailwindcss": "^3.4.0",
"ts-jest": "^29.1.1",
"typescript": "^5.3.3",
"vite": "^5.0.10"
},
Expand Down
Loading

3 comments on commit 0c3e049

@vercel
Copy link

@vercel vercel bot commented on 0c3e049 Jan 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

quri-ui – ./packages/ui

quri-ui-quantified-uncertainty.vercel.app
quri-ui-git-main-quantified-uncertainty.vercel.app
quri-ui.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 0c3e049 Jan 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 0c3e049 Jan 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.