Skip to content

Commit

Permalink
Remove enzyme
Browse files Browse the repository at this point in the history
  • Loading branch information
aarongarciah committed Jun 24, 2024
1 parent 580a334 commit 0cbf421
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 152 deletions.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@
"@babel/preset-react": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@babel/register": "^7.24.6",
"@mnajdova/enzyme-adapter-react-18": "^0.2.0",
"@mui-internal/api-docs-builder": "workspace:^",
"@mui-internal/api-docs-builder-core": "workspace:^",
"@mui/internal-docs-utils": "workspace:^",
Expand All @@ -120,7 +119,6 @@
"@octokit/rest": "^20.1.1",
"@pigment-css/react": "^0.0.13",
"@playwright/test": "1.44.1",
"@types/enzyme": "^3.10.18",
"@types/fs-extra": "^11.0.4",
"@types/lodash": "^4.17.5",
"@types/mocha": "^10.0.7",
Expand Down
3 changes: 0 additions & 3 deletions packages-internal/test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,11 @@
"@babel/runtime": "^7.24.7",
"@emotion/cache": "^11.11.0",
"@emotion/react": "^11.11.4",
"@mnajdova/enzyme-adapter-react-18": "^0.2.0",
"@testing-library/dom": "^10.1.0",
"@testing-library/react": "^16.0.0",
"chai": "^4.4.1",
"chai-dom": "^1.12.0",
"dom-accessibility-api": "^0.6.3",
"enzyme": "^3.11.0",
"format-util": "^1.0.5",
"fs-extra": "^11.2.0",
"jsdom": "^24.0.0",
Expand All @@ -57,7 +55,6 @@
"devDependencies": {
"@types/chai": "^4.3.16",
"@types/chai-dom": "^1.11.3",
"@types/enzyme": "^3.10.18",
"@types/format-util": "^1.0.4",
"@types/prop-types": "^15.7.12",
"@types/react": "^18.2.55",
Expand Down
4 changes: 0 additions & 4 deletions packages-internal/test-utils/src/init.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import enzyme from 'enzyme';
import Adapter from '@mnajdova/enzyme-adapter-react-18';
import * as testingLibrary from '@testing-library/react/pure';
import './initMatchers';

enzyme.configure({ adapter: new Adapter() });

// checking if an element is hidden is quite expensive
// this is only done in CI as a fail safe. It can still explicitly be checked
// in the test files which helps documenting what is part of the DOM but hidden
Expand Down
130 changes: 14 additions & 116 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions scripts/useReactVersion.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ const exec = promisify(childProcess.exec);

// packages published from the react monorepo using the same version
const reactPackageNames = ['react', 'react-dom', 'react-is', 'react-test-renderer', 'scheduler'];
const devDependenciesPackageNames = ['@mnajdova/enzyme-adapter-react-18', '@testing-library/react'];
const devDependenciesPackageNames = ['@testing-library/react'];

// if we need to support more versions we will need to add new mapping here
const additionalVersionsMappings = {
17: {
'@mnajdova/enzyme-adapter-react-18': 'npm:@eps1lon/enzyme-adapter-react-17',
'@testing-library/react': '^12.1.0',
},
};
Expand Down Expand Up @@ -82,8 +81,6 @@ async function main(version) {
// At this moment all dist tags reference React 18 version, so we don't need
// to update these dependencies unless an older version is used, or when the
// next/experimental dist tag reference to a future version of React
// packageJson.devDependencies['@mnajdova/enzyme-adapter-react-18'] =
// 'npm:@mnajdova/enzyme-adapter-react-next';
// packageJson.devDependencies['@testing-library/react'] = 'alpha';

if (majorVersion && additionalVersionsMappings[majorVersion]) {
Expand Down
Loading

0 comments on commit 0cbf421

Please sign in to comment.