Skip to content

Commit

Permalink
fix react 18 test
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Nov 28, 2021
1 parent f90fd22 commit ca39e38
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions test/integration/react-18/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ describe('React 18 Support', () => {
describe('Use legacy render', () => {
beforeAll(async () => {
await fs.remove(join(appDir, 'node_modules'))
nextConfig.replace('reactRoot: true', '// reactRoot: true')
nextConfig.replace('reactRoot: true', 'reactRoot: false')
})
afterAll(() => {
nextConfig.replace('// reactRoot: true', 'reactRoot: true')
nextConfig.replace('reactRoot: false', 'reactRoot: true')
})

test('supported version of react in dev', async () => {
Expand Down
4 changes: 3 additions & 1 deletion test/integration/react-18/test/with-react-18.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
module.exports = function withReact18(config) {
config.experimental.reactRoot = true
if (typeof config.experimental.reactRoot === 'undefined') {
config.experimental.reactRoot = true
}

config.webpack = (webpackConfig) => {
const { alias } = webpackConfig.resolve
Expand Down

0 comments on commit ca39e38

Please sign in to comment.