未验证 提交 61e899f4 编写于 作者: D Darsh Patel 提交者: GitHub

Fix bug in profiling test (#14921)

上级 1cd6bb5b
......@@ -4,18 +4,23 @@ import { join } from 'path'
import { nextBuild } from 'next-test-utils'
import fs from 'fs'
const appDir = join(__dirname, '../')
const profileEventsPath = join(appDir, '.next', 'profile-events.json')
jest.setTimeout(1000 * 60 * 5)
describe('Profiling Usage', () => {
beforeAll(async () => {
// Delete file if it already exists
if (await fs.existsSync(profileEventsPath))
await fs.unlink(profileEventsPath, () => {
console.log('Deleted Existing profile-events.json file')
})
await nextBuild(appDir)
})
describe('Profiling the build', () => {
it('should emit files', async () => {
expect(fs.existsSync(join(appDir, '.next', 'profile-events.json'))).toBe(
true
)
expect(fs.existsSync(profileEventsPath)).toBe(true)
})
})
})
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册