Skip to content

Commit ac680c4

Browse files
authored
Turbopack Build: Skip edge stacktrace test (#79661)
## What? This test is checking a specific path that is not actually sourcemapped when using webpack either. This won't fail for both webpack/Turbopack once edge runtime supports sourcemaps.
1 parent fffb2eb commit ac680c4

File tree

2 files changed

+36
-30
lines changed

2 files changed

+36
-30
lines changed

test/e2e/fetch-failures-have-good-stack-traces-in-edge-runtime/fetch-failures-have-good-stack-traces-in-edge-runtime.test.ts

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,39 @@ describe('fetch failures have good stack traces in edge runtime', () => {
1414
return
1515
}
1616

17-
it('when awaiting `fetch` using an unknown domain, stack traces are preserved', async () => {
18-
const outputIndex = next.cliOutput.length
19-
const browser = await webdriver(next.url, '/api/unknown-domain')
17+
// TODO: Failure is not specific to Turbopack, edge runtime errors don't have source maps applied.
18+
;(process.env.IS_TURBOPACK_TEST && isNextStart ? it.skip : it)(
19+
'when awaiting `fetch` using an unknown domain, stack traces are preserved',
20+
async () => {
21+
const outputIndex = next.cliOutput.length
22+
const browser = await webdriver(next.url, '/api/unknown-domain')
2023

21-
if (isNextStart) {
22-
expect(next.cliOutput.slice(outputIndex)).toMatch(
23-
/at.+\/pages\/api\/unknown-domain.js/
24-
)
25-
} else if (isNextDev) {
26-
expect(stripAnsi(next.cliOutput.slice(outputIndex))).toContain(
27-
'' +
28-
'\n ⨯ Error [TypeError]: fetch failed' +
29-
'\n at anotherFetcher (src/fetcher.js:6:15)' +
30-
'\n at fetcher (src/fetcher.js:2:15)' +
31-
'\n at UnknownDomainEndpoint (pages/api/unknown-domain.js:6:16)' +
32-
'\n 4 |' +
33-
'\n 5 | async function anotherFetcher(...args) {' +
34-
'\n> 6 | return await fetch(...args)' +
35-
'\n | ^' +
36-
'\n 7 | }' +
37-
'\n 8 |' +
38-
// TODO(veil): Why double error?
39-
'\n ⨯ Error [TypeError]: fetch failed'
40-
)
24+
if (isNextStart) {
25+
// eslint-disable-next-line jest/no-standalone-expect
26+
expect(next.cliOutput.slice(outputIndex)).toMatch(
27+
/at.+\/pages\/api\/unknown-domain.js/
28+
)
29+
} else if (isNextDev) {
30+
// eslint-disable-next-line jest/no-standalone-expect
31+
expect(stripAnsi(next.cliOutput.slice(outputIndex))).toContain(
32+
'' +
33+
'\n ⨯ Error [TypeError]: fetch failed' +
34+
'\n at anotherFetcher (src/fetcher.js:6:15)' +
35+
'\n at fetcher (src/fetcher.js:2:15)' +
36+
'\n at UnknownDomainEndpoint (pages/api/unknown-domain.js:6:16)' +
37+
'\n 4 |' +
38+
'\n 5 | async function anotherFetcher(...args) {' +
39+
'\n> 6 | return await fetch(...args)' +
40+
'\n | ^' +
41+
'\n 7 | }' +
42+
'\n 8 |' +
43+
// TODO(veil): Why double error?
44+
'\n ⨯ Error [TypeError]: fetch failed'
45+
)
4146

42-
// TODO(veil): Why column off by one?
43-
await expect(browser).toDisplayRedbox(`
47+
// TODO(veil): Why column off by one?
48+
// eslint-disable-next-line jest/no-standalone-expect
49+
await expect(browser).toDisplayRedbox(`
4450
{
4551
"description": "fetch failed",
4652
"environmentLabel": null,
@@ -55,8 +61,9 @@ describe('fetch failures have good stack traces in edge runtime', () => {
5561
],
5662
}
5763
`)
64+
}
5865
}
59-
})
66+
)
6067

6168
// TODO: It need to have source maps picked up by node.js
6269
it.skip('when returning `fetch` using an unknown domain, stack traces are preserved', async () => {

test/turbopack-build-tests-manifest.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6621,11 +6621,10 @@
66216621
},
66226622
"test/e2e/fetch-failures-have-good-stack-traces-in-edge-runtime/fetch-failures-have-good-stack-traces-in-edge-runtime.test.ts": {
66236623
"passed": [],
6624-
"failed": [
6625-
"fetch failures have good stack traces in edge runtime when awaiting `fetch` using an unknown domain, stack traces are preserved"
6626-
],
6624+
"failed": [],
66276625
"pending": [
6628-
"fetch failures have good stack traces in edge runtime when returning `fetch` using an unknown domain, stack traces are preserved"
6626+
"fetch failures have good stack traces in edge runtime when returning `fetch` using an unknown domain, stack traces are preserved",
6627+
"fetch failures have good stack traces in edge runtime when awaiting `fetch` using an unknown domain, stack traces are preserved"
66296628
],
66306629
"flakey": [],
66316630
"runtimeError": false

0 commit comments

Comments
 (0)