Skip to content

Commit bd28752

Browse files
authored
Fix conflicting-app-page-error test for Turbopack (#62747)
## What? Fixes the check for Turbopack. Follow-up to #62531 which fixes the underlying issue but it wasn't checking the right value. <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # --> Closes NEXT-2665
1 parent 04b13f5 commit bd28752

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

test/e2e/conflicting-app-page-error/index.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
hasRedbox,
44
getRedboxSource,
55
retry,
6+
getRedboxDescription,
67
} from 'next-test-utils'
78
import { createNextDescribe } from 'e2e-utils'
89

@@ -45,16 +46,17 @@ createNextDescribe(
4546
async function containConflictsError(browser, conflicts) {
4647
await retry(async () => {
4748
expect(await hasRedbox(browser)).toBe(true)
48-
const redboxSource = await getRedboxSource(browser)
4949
if (process.env.TURBOPACK) {
50-
expect(redboxSource).toContain(
50+
expect(await getRedboxDescription(browser)).toContain(
5151
'App Router and Pages Router both match path:'
5252
)
5353
}
5454

5555
if (!process.env.TURBOPACK) {
5656
for (const pair of conflicts) {
57-
expect(redboxSource).toContain(`"${pair[0]}" - "${pair[1]}"`)
57+
expect(await getRedboxSource(browser)).toContain(
58+
`"${pair[0]}" - "${pair[1]}"`
59+
)
5860
}
5961
}
6062
})

test/turbopack-tests-manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4940,13 +4940,13 @@
49404940
"runtimeError": false
49414941
},
49424942
"test/e2e/conflicting-app-page-error/index.test.ts": {
4943-
"passed": [],
4944-
"failed": [
4943+
"passed": [
49454944
"Conflict between app file and pages file should error again when there is new conflict",
49464945
"Conflict between app file and pages file should show error overlay for /",
49474946
"Conflict between app file and pages file should show error overlay for /another",
49484947
"Conflict between app file and pages file should support hmr with conflicts"
49494948
],
4949+
"failed": [],
49504950
"pending": [],
49514951
"flakey": [
49524952
"Conflict between app file and pages file should not show error overlay for non conflict pages under app or pages dir"

0 commit comments

Comments
 (0)