Unverified Commit d11156c2 authored by Tobias Koppers's avatar Tobias Koppers Committed by GitHub

Turbopack: disable webpack specific test cases (#57423)

These tests test webpack specific behavior

Closes WEB-1857
parent 462b8585
...@@ -520,45 +520,51 @@ describe.each([[''], ['/docs']])( ...@@ -520,45 +520,51 @@ describe.each([[''], ['/docs']])(
} }
}) })
it('should show the error on all pages', async () => { if (!process.env.TURBOPACK) {
const aboutPage = join('pages', 'hmr', 'about2.js') // Turbopack doesn't have this restriction
const aboutContent = await next.readFile(aboutPage) it('should show the error on all pages', async () => {
let browser const aboutPage = join('pages', 'hmr', 'about2.js')
try { const aboutContent = await next.readFile(aboutPage)
await renderViaHTTP(next.url, basePath + '/hmr/about2') let browser
try {
await renderViaHTTP(next.url, basePath + '/hmr/about2')
await next.patchFile(aboutPage, aboutContent.replace('</div>', 'div')) await next.patchFile(
aboutPage,
aboutContent.replace('</div>', 'div')
)
// Ensure dev server has time to break: // Ensure dev server has time to break:
await new Promise((resolve) => setTimeout(resolve, 2000)) await new Promise((resolve) => setTimeout(resolve, 2000))
browser = await webdriver(next.url, basePath + '/hmr/contact') browser = await webdriver(next.url, basePath + '/hmr/contact')
expect(await hasRedbox(browser, true)).toBe(true) expect(await hasRedbox(browser, true)).toBe(true)
expect(await getRedboxSource(browser)).toMatch(/Unexpected eof/) expect(await getRedboxSource(browser)).toMatch(/Unexpected eof/)
await next.patchFile(aboutPage, aboutContent) await next.patchFile(aboutPage, aboutContent)
await check(
() => getBrowserBodyText(browser),
/This is the contact page/
)
} catch (err) {
await next.patchFile(aboutPage, aboutContent)
if (browser) {
await check( await check(
() => getBrowserBodyText(browser), () => getBrowserBodyText(browser),
/This is the contact page/ /This is the contact page/
) )
} } catch (err) {
await next.patchFile(aboutPage, aboutContent)
if (browser) {
await check(
() => getBrowserBodyText(browser),
/This is the contact page/
)
}
throw err throw err
} finally { } finally {
if (browser) { if (browser) {
await browser.close() await browser.close()
}
} }
} })
}) }
it('should detect runtime errors on the module scope', async () => { it('should detect runtime errors on the module scope', async () => {
let browser let browser
...@@ -1116,13 +1122,15 @@ describe.each([[''], ['/docs']])( ...@@ -1116,13 +1122,15 @@ describe.each([[''], ['/docs']])(
}) })
}) })
it('should have client HMR events in trace file', async () => { if (!process.env.TURBOPACK) {
const traceData = await next.readFile('.next/trace') it('should have client HMR events in trace file', async () => {
expect(traceData).toContain('client-hmr-latency') const traceData = await next.readFile('.next/trace')
expect(traceData).toContain('client-error') expect(traceData).toContain('client-hmr-latency')
expect(traceData).toContain('client-success') expect(traceData).toContain('client-error')
expect(traceData).toContain('client-full-reload') expect(traceData).toContain('client-success')
}) expect(traceData).toContain('client-full-reload')
})
}
it('should have correct compile timing after fixing error', async () => { it('should have correct compile timing after fixing error', async () => {
const pageName = 'pages/auto-export-is-ready.js' const pageName = 'pages/auto-export-is-ready.js'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment