Skip to content

Commit

Permalink
chore: move jest and babel on lib folder (#2653)
Browse files Browse the repository at this point in the history
  • Loading branch information
theo-mesnil authored Jan 23, 2025
1 parent fbe3d31 commit 7666456
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 37 deletions.
File renamed without changes.
4 changes: 2 additions & 2 deletions jest.config.js → lib/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module.exports = {
moduleNameMapper: {
'\\.(css|less)$': '<rootDir>/mocks/styleMock.js',
'\\.(css|less)$': '<rootDir>/tests/styleMock.ts',
},
transform: {
'^.+\\.(ts|tsx|js|jsx)?$': 'babel-jest',
},
setupFilesAfterEnv: ['<rootDir>/mocks/setup.js'],
setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'],
modulePaths: ['<rootDir>/node_modules'],
testEnvironment: 'jest-environment-jsdom',
}
27 changes: 25 additions & 2 deletions lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
},
"scripts": {
"start": "vite build --watch",
"build": "vite build"
"build": "vite build",
"test": "yarn jest"
},
"repository": {
"type": "git",
Expand All @@ -50,23 +51,42 @@
"@ariakit/react": "0.4.15"
},
"devDependencies": {
"@babel/cli": "7.25.9",
"@babel/core": "7.25.2",
"@babel/eslint-parser": "^7.25.1",
"@babel/plugin-proposal-class-properties": "7.18.6",
"@babel/plugin-proposal-optional-chaining": "7.21.0",
"@babel/plugin-transform-modules-commonjs": "7.25.9",
"@babel/plugin-transform-runtime": "^7.25.4",
"@babel/preset-env": "^7.26.0",
"@babel/preset-react": "^7.26.3",
"@babel/preset-typescript": "^7.22.11",
"@juggle/resize-observer": "^3.4.0",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.1.0",
"@testing-library/react": "^16.0.1",
"@testing-library/user-event": "^14.5.2",
"@types/jest": "^29.5.13",
"@types/lodash.capitalize": "^4.2.9",
"@types/lodash.debounce": "^4.0.6",
"@types/lodash.range": "^3.2.9",
"@types/react": "^18.3.12",
"@types/react-datepicker": "^4.15.0",
"@xstyled/styled-components": "^3.7.3",
"babel-jest": "^29.7.0",
"babel-plugin-annotate-pure-calls": "^0.4.0",
"babel-plugin-transform-async-to-promises": "^0.8.18",
"babel-preset-vite": "^1.1.3",
"copy-to-clipboard": "^3.3.3",
"date-fns": "^4.1.0",
"downshift": "^7.4.1",
"lodash.capitalize": "^4.2.1",
"lodash.debounce": "^4.0.8",
"lodash.range": "^3.2.0",
"lottie-light-react": "^2.4.0",
"jest": "29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-styled-components": "7.2.0",
"match-sorter": "^8.0.0",
"react": "^18.0.0",
"react-datepicker": "^4.16.0",
Expand Down Expand Up @@ -129,5 +149,8 @@
"optional": true
}
},
"resolutions": {
"@babel/traverse": ">=7.23.2"
},
"homepage": "https://welcome-ui.com"
}
2 changes: 2 additions & 0 deletions lib/tests/setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* eslint-disable @typescript-eslint/no-empty-function */
window.focus = () => {}
File renamed without changes.
1 change: 0 additions & 1 deletion mocks/setup.js

This file was deleted.

25 changes: 1 addition & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"dev:prerelease": "todo",
"release": "todo",
"start": "cd lib && yarn start",
"test": "yarn jest",
"test": "cd lib && yarn test",
"website": "cd website && yarn dev -p 3020"
},
"private": true,
Expand Down Expand Up @@ -50,25 +50,10 @@
"url": "https://github.com/WTTJ/welcome-ui/issues"
},
"devDependencies": {
"@babel/cli": "7.25.9",
"@babel/core": "7.25.2",
"@babel/eslint-parser": "^7.25.1",
"@babel/plugin-proposal-class-properties": "7.18.6",
"@babel/plugin-proposal-optional-chaining": "7.21.0",
"@babel/plugin-transform-modules-commonjs": "7.25.9",
"@babel/plugin-transform-runtime": "^7.25.4",
"@babel/preset-env": "^7.26.0",
"@babel/preset-react": "^7.26.3",
"@babel/preset-typescript": "^7.22.11",
"@commitlint/cli": "^17.7.1",
"@commitlint/config-conventional": "^17.7.0",
"@swc/core": "^1.3.86",
"@swc/jest": "^0.2.29",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.0.1",
"@testing-library/user-event": "^14.5.2",
"@types/jest": "^29.5.13",
"@types/ramda": "^0.30.2",
"@types/react": "18.0.25",
"@types/react-dom": "18.3.1",
Expand All @@ -79,19 +64,12 @@
"@vusion/webfonts-generator": "^0.8.0",
"@xstyled/styled-components": "^3.7.3",
"aws-sdk": "^2.1691.0",
"babel-jest": "^29.7.0",
"babel-plugin-annotate-pure-calls": "^0.4.0",
"babel-plugin-transform-async-to-promises": "^0.8.18",
"babel-preset-vite": "^1.1.3",
"colors": "^1.4.0",
"conventional-github-releaser": "^3.1.3",
"eslint-plugin-typescript-sort-keys": "^3.3.0",
"esm": "^3.2.25",
"glob": "^11.0.0",
"husky": "8.0.3",
"jest": "29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-styled-components": "7.2.0",
"lodash.difference": "^4.5.0",
"minimist": "1.2.8",
"onchange": "^7.0.2",
Expand All @@ -109,7 +87,6 @@
"yargs": "^17.7.2"
},
"resolutions": {
"@babel/traverse": ">=7.23.2",
"@types/react": "18.0.25",
"styled-components": "5.3.9"
},
Expand Down
9 changes: 1 addition & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1431,7 +1431,7 @@
"@babel/parser" "^7.25.9"
"@babel/types" "^7.25.9"

"@babel/traverse@>=7.23.2", "@babel/traverse@^7.24.7", "@babel/traverse@^7.24.8", "@babel/traverse@^7.25.0", "@babel/traverse@^7.25.2", "@babel/traverse@^7.25.4", "@babel/traverse@^7.25.9", "@babel/traverse@^7.4.5":
"@babel/traverse@^7.24.7", "@babel/traverse@^7.24.8", "@babel/traverse@^7.25.0", "@babel/traverse@^7.25.2", "@babel/traverse@^7.25.4", "@babel/traverse@^7.25.9", "@babel/traverse@^7.4.5":
version "7.26.4"
resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.26.4.tgz#ac3a2a84b908dde6d463c3bfa2c5fdc1653574bd"
integrity sha512-fH+b7Y4p3yqvApJALCPJcwb0/XaOSgtK4pzV6WVjPR5GLFQBRI7pfoX2V2iM48NXvX07NUxxm1Vw98YjqTcU5w==
Expand Down Expand Up @@ -2688,13 +2688,6 @@
dependencies:
"@babel/runtime" "^7.12.5"

"@testing-library/react@^16.1.0":
version "16.1.0"
resolved "https://registry.yarnpkg.com/@testing-library/react/-/react-16.1.0.tgz#aa0c61398bac82eaf89776967e97de41ac742d71"
integrity sha512-Q2ToPvg0KsVL0ohND9A3zLJWcOXXcO8IDu3fj11KhNt0UlCWyFyvnCIBkd12tidB2lkiVRG8VFqdhcqhqnAQtg==
dependencies:
"@babel/runtime" "^7.12.5"

"@testing-library/user-event@^14.5.2":
version "14.5.2"
resolved "https://registry.yarnpkg.com/@testing-library/user-event/-/user-event-14.5.2.tgz#db7257d727c891905947bd1c1a99da20e03c2ebd"
Expand Down

0 comments on commit 7666456

Please sign in to comment.