Skip to content

Commit

Permalink
Support interrupts and focus in react-profiling-mode test (vercel#65200)
Browse files Browse the repository at this point in the history
Closes NEXT-3263
  • Loading branch information
eps1lon authored May 6, 2024
1 parent 55e6087 commit 7cfe6fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
3 changes: 2 additions & 1 deletion test/integration/react-profiling-mode/next.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module.exports = {
reactProductionProfiling: true,
reactProductionProfiling:
process.env.TEST_REACT_PRODUCTION_PROFILING === 'true',
}
19 changes: 6 additions & 13 deletions test/integration/react-profiling-mode/test/index.test.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
/* eslint-env jest */

import fs from 'fs-extra'
import { join } from 'path'
import webdriver from 'next-webdriver'
import { nextBuild, nextStart, findPort, killApp } from 'next-test-utils'

const appDir = join(__dirname, '..')
const nextConfig = join(appDir, 'next.config.js')

let appPort
let app
Expand All @@ -17,20 +15,13 @@ describe('React Profiling Mode', () => {
() => {
describe('without config enabled', () => {
beforeAll(async () => {
await fs.remove(nextConfig)
await nextBuild(appDir)
await nextBuild(appDir, [], {
env: { TEST_REACT_PRODUCTION_PROFILING: 'false' },
})
appPort = await findPort()
app = await nextStart(appDir, appPort)
})
afterAll(async () => {
await fs.writeFile(
nextConfig,
`
module.exports = {
reactProductionProfiling: true
}
`
)
await killApp(app)
})

Expand All @@ -44,7 +35,9 @@ describe('React Profiling Mode', () => {

describe('with config enabled', () => {
beforeAll(async () => {
await nextBuild(appDir, ['--profile'])
await nextBuild(appDir, ['--profile'], {
env: { TEST_REACT_PRODUCTION_PROFILING: 'true' },
})
appPort = await findPort()
app = await nextStart(appDir, appPort)
})
Expand Down

0 comments on commit 7cfe6fd

Please sign in to comment.