Skip to content

Commit 2684a46

Browse files
committed
[test] Use unique error messages in server-source-maps
Allows unambigious assertions on CLI output. Not that interesting for dev but `next build` will have the logs for all pages in all tests.
1 parent 6ba4290 commit 2684a46

File tree

13 files changed

+50
-44
lines changed

13 files changed

+50
-44
lines changed

test/e2e/app-dir/server-source-maps/fixtures/default/app/bad-sourcemap/page.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/e2e/app-dir/server-source-maps/fixtures/default/app/bad-sourcemap/page.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/e2e/app-dir/server-source-maps/fixtures/default/app/rsc-error-log-cause/page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { connection } from 'next/server'
22

33
function logError(cause) {
4-
const error = new Error('Boom', { cause })
4+
const error = new Error('rsc-error-log-cause', { cause })
55
console.error(error)
66
}
77

test/e2e/app-dir/server-source-maps/fixtures/default/app/rsc-error-log-custom-name/page.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class NamedError extends Error {
88
export default async function Page() {
99
await connection()
1010

11-
console.error(new UnnamedError('Foo'))
12-
console.error(new NamedError('Bar'))
11+
console.error(new UnnamedError('rsc-error-log-custom-name-Foo'))
12+
console.error(new NamedError('rsc-error-log-custom-name-Bar'))
1313
return null
1414
}

test/e2e/app-dir/server-source-maps/fixtures/default/app/rsc-error-log-ignore-listed/page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { runExternal } from 'external-pkg'
66
import { runExternalSourceMapped } from 'external-pkg/sourcemapped'
77

88
function logError() {
9-
const error = new Error('Boom')
9+
const error = new Error('rsc-error-log-ignore-listed')
1010
console.error(error)
1111
}
1212

test/e2e/app-dir/server-source-maps/fixtures/default/app/rsc-error-log/page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { someClass } from './styles.module.css'
22
import { connection } from 'next/server'
33

44
function logError() {
5-
const error = new Error('Boom')
5+
const error = new Error('rsc-error-log')
66
console.error(error)
77
}
88

test/e2e/app-dir/server-source-maps/fixtures/default/app/ssr-error-log-ignore-listed/page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { runExternal } from 'external-pkg'
66
import { runExternalSourceMapped } from 'external-pkg/sourcemapped'
77

88
function logError() {
9-
const error = new Error('Boom')
9+
const error = new Error('ssr-error-log-ignore-listed')
1010
console.error(error)
1111
}
1212

test/e2e/app-dir/server-source-maps/fixtures/default/app/ssr-throw/Thrower.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use client'
22

33
function throwError() {
4-
throw new Error('Boom')
4+
throw new Error('ssr-throw')
55
}
66

77
export function Thrower() {

test/e2e/app-dir/server-source-maps/fixtures/default/bad-sourcemap/page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import { connection } from 'next/server'
66

77
function logError() {
8-
console.error(new Error('Boom!'))
8+
console.error(new Error('bad-sourcemap'))
99
}
1010

1111
export default async function Page() {

test/e2e/app-dir/server-source-maps/fixtures/edge/app/rsc-error-log/page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function logError() {
2-
console.error(new Error('Boom'))
2+
console.error(new Error('rsc-error-log'))
33
}
44

55
export default function Page() {

0 commit comments

Comments
 (0)