Skip to content

Commit

Permalink
Adapt envinfo test to pass
Browse files Browse the repository at this point in the history
  • Loading branch information
aarongarciah committed Aug 26, 2024
1 parent 8979c6f commit 1d319e9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/mui-envinfo/envinfo.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,16 @@ describe('@mui/envinfo', () => {
// Other libraries
expect(envinfo).to.have.nested.property('npmPackages.react');
expect(envinfo).to.have.nested.property('npmPackages.react-dom');
expect(envinfo).to.have.nested.property('npmPackages.@types/react');

// TODO: remove this check once React 19 stable types are released
// React 19 RC requires setting `@types/react' to `npm:[email protected]`
// See https://react.dev/blog/2024/04/25/react-19-upgrade-guide#installing
if (process.env.REACT_VERSION === 'next') {
expect(envinfo).to.have.nested.property('npmPackages.@types/react');
} else {
expect(envinfo).to.have.nested.property('npmPackages.types-react');
}

expect(envinfo).to.have.nested.property('npmPackages.@emotion/react');
expect(envinfo).to.have.nested.property('npmPackages.@emotion/styled');
});
Expand Down

0 comments on commit 1d319e9

Please sign in to comment.