Skip to content

Commit 8e343d7

Browse files
committed
fix test cases
1 parent 2b7ca40 commit 8e343d7

File tree

2 files changed

+45
-65
lines changed

2 files changed

+45
-65
lines changed

test/e2e/app-dir/non-root-project-monorepo/non-root-project-monorepo.test.ts

+45-45
Original file line numberDiff line numberDiff line change
@@ -66,25 +66,25 @@ describe('non-root-project-monorepo', () => {
6666
if (isTurbopack) {
6767
// TODO the function name should be hidden
6868
expect(await getRedboxSource(browser)).toMatchInlineSnapshot(`
69-
"app/source-maps-rsc/page.tsx (9:28) @ innerArrowFunction
70-
71-
7 | }
72-
8 |
73-
> 9 | const innerArrowFunction = () => {
74-
| ^
75-
10 | require('../separate-file')
76-
11 | }
77-
12 |"
69+
"app/source-maps-rsc/page.tsx (13:28) @ innerArrowFunction
70+
71+
11 | }
72+
12 |
73+
> 13 | const innerArrowFunction = () => {
74+
| ^
75+
14 | require('../separate-file')
76+
15 | }
77+
16 |"
7878
`)
7979
// TODO stacktrace-parser breaks in some cases with the rsc:// protocol
8080
expect(normalizeStackTrace(await getRedboxCallStack(browser)))
8181
.toMatchInlineSnapshot(`
82-
"<unknown>
83-
[project]/apps/web/app/separate-file.ts [app-rsc] (ecmascript) (rsc://React/Server/file://<full-path>/apps/web/.next/server/chunks/ssr/apps_web_8d1c0a._.js (7:7)
84-
innerFunction
85-
app/source-maps-rsc/page.tsx (6:3)
86-
Page
87-
app/source-maps-rsc/page.tsx (2:3)"
82+
"<unknown>
83+
[project]/apps/web/app/separate-file.ts [app-rsc] (ecmascript) (rsc://React/Server/file://<full-path>/apps/web/.next/server/chunks/ssr/apps_web_8d1c0a._.js (7:7)
84+
innerFunction
85+
app/source-maps-rsc/page.tsx (10:3)
86+
Page
87+
app/source-maps-rsc/page.tsx (4:5)"
8888
`)
8989
} else {
9090
// TODO the function name is incorrect
@@ -98,16 +98,16 @@ describe('non-root-project-monorepo', () => {
9898
// TODO webpack runtime code shouldn't be included in stack trace
9999
expect(normalizeStackTrace(await getRedboxCallStack(browser)))
100100
.toMatchInlineSnapshot(`
101-
"<unknown>
102-
rsc)/./app/separate-file.ts (rsc://React/Server/file://<full-path>/apps/web/.next/server/app/source-maps-rsc/page.js
103-
__webpack_require__
104-
file://<full-path>/apps/web/.next/server/webpack-runtime.js
105-
require
106-
app/source-maps-rsc/page.tsx (10:3)
107-
innerArrowFunction
108-
app/source-maps-rsc/page.tsx (6:3)
109-
innerFunction
110-
app/source-maps-rsc/page.tsx (2:3)"
101+
"<unknown>
102+
rsc)/./app/separate-file.ts (rsc://React/Server/file://<full-path>/apps/web/.next/server/app/source-maps-rsc/page.js
103+
__webpack_require__
104+
file://<full-path>/apps/web/.next/server/webpack-runtime.js
105+
require
106+
app/source-maps-rsc/page.tsx (14:3)
107+
innerArrowFunction
108+
app/source-maps-rsc/page.tsx (10:3)
109+
innerFunction
110+
app/source-maps-rsc/page.tsx (4:5)"
111111
`)
112112
}
113113
await browser.close()
@@ -128,12 +128,12 @@ describe('non-root-project-monorepo', () => {
128128
`)
129129
expect(normalizeStackTrace(await getRedboxCallStack(browser)))
130130
.toMatchInlineSnapshot(`
131-
"innerArrowFunction
132-
app/source-maps-ssr/page.tsx (11:28)
133-
innerFunction
134-
app/source-maps-ssr/page.tsx (8:3)
135-
Page
136-
app/source-maps-ssr/page.tsx (4:3)"
131+
"innerArrowFunction
132+
app/source-maps-ssr/page.tsx (15:28)
133+
innerFunction
134+
app/source-maps-ssr/page.tsx (12:3)
135+
Page
136+
app/source-maps-ssr/page.tsx (6:5)"
137137
`)
138138
} else {
139139
// TODO the function name should be hidden
@@ -147,20 +147,20 @@ describe('non-root-project-monorepo', () => {
147147
// TODO webpack runtime code shouldn't be included in stack trace
148148
expect(normalizeStackTrace(await getRedboxCallStack(browser)))
149149
.toMatchInlineSnapshot(`
150-
"./app/separate-file.ts
151-
file://<full-path>/apps/web/.next/static/chunks/app/source-maps-ssr/page.js (27:1)
152-
options.factory
153-
file://<full-path>/apps/web/.next/static/chunks/webpack.js (700:31)
154-
__webpack_require__
155-
file://<full-path>/apps/web/.next/static/chunks/webpack.js (37:33)
156-
fn
157-
file://<full-path>/apps/web/.next/static/chunks/webpack.js (357:21)
158-
require
159-
app/source-maps-ssr/page.tsx (12:3)
160-
innerArrowFunction
161-
app/source-maps-ssr/page.tsx (8:3)
162-
innerFunction
163-
app/source-maps-ssr/page.tsx (4:3)"
150+
"./app/separate-file.ts
151+
file://<full-path>/apps/web/.next/static/chunks/app/source-maps-ssr/page.js (27:1)
152+
options.factory
153+
file://<full-path>/apps/web/.next/static/chunks/webpack.js (700:31)
154+
__webpack_require__
155+
file://<full-path>/apps/web/.next/static/chunks/webpack.js (37:33)
156+
fn
157+
file://<full-path>/apps/web/.next/static/chunks/webpack.js (357:21)
158+
require
159+
app/source-maps-ssr/page.tsx (16:3)
160+
innerArrowFunction
161+
app/source-maps-ssr/page.tsx (12:3)
162+
innerFunction
163+
app/source-maps-ssr/page.tsx (6:5)"
164164
`)
165165
}
166166
await browser.close()

test/integration/server-side-dev-errors/test/index.test.js

-20
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@ describe('server-side dev errors', () => {
6666

6767
const stderrOutput = stripAnsi(stderr.slice(stderrIdx)).trim()
6868
if (isTurbopack) {
69-
expect(stderrOutput).toStartWith(
70-
' ⨯ ../../test/integration/server-side-dev-errors/pages/gsp.js (6:3) @ getStaticProps' +
71-
'\n ⨯ ../../test/integration/server-side-dev-errors/pages/gsp.js (6:3) @ getStaticProps'
72-
)
7369
expect(stderrOutput).toContain(
7470
' ⨯ ReferenceError: missingVar is not defined' +
7571
'\n at getStaticProps (../../test/integration/server-side-dev-errors/pages/gsp.js:6:2)' +
@@ -121,10 +117,6 @@ describe('server-side dev errors', () => {
121117

122118
const stderrOutput = stripAnsi(stderr.slice(stderrIdx)).trim()
123119
if (isTurbopack) {
124-
expect(stderrOutput).toStartWith(
125-
' ⨯ ../../test/integration/server-side-dev-errors/pages/gssp.js (6:3) @ getServerSideProps' +
126-
'\n ⨯ ../../test/integration/server-side-dev-errors/pages/gssp.js (6:3) @ getServerSideProps'
127-
)
128120
expect(stderrOutput).toContain(
129121
' ⨯ ReferenceError: missingVar is not defined' +
130122
'\n at getServerSideProps (../../test/integration/server-side-dev-errors/pages/gssp.js:6:2)' +
@@ -176,10 +168,6 @@ describe('server-side dev errors', () => {
176168

177169
const stderrOutput = stripAnsi(stderr.slice(stderrIdx)).trim()
178170
if (isTurbopack) {
179-
expect(stderrOutput).toStartWith(
180-
' ⨯ ../../test/integration/server-side-dev-errors/pages/blog/[slug].js (6:3) @ getServerSideProps' +
181-
'\n ⨯ ../../test/integration/server-side-dev-errors/pages/blog/[slug].js (6:3) @ getServerSideProps'
182-
)
183171
expect(stderrOutput).toContain(
184172
' ⨯ ReferenceError: missingVar is not defined' +
185173
'\n at getServerSideProps (../../test/integration/server-side-dev-errors/pages/blog/[slug].js:6:2)' +
@@ -231,10 +219,6 @@ describe('server-side dev errors', () => {
231219

232220
const stderrOutput = stripAnsi(stderr.slice(stderrIdx)).trim()
233221
if (isTurbopack) {
234-
expect(stderrOutput).toStartWith(
235-
' ⨯ ../../test/integration/server-side-dev-errors/pages/api/hello.js (2:3) @ handler' +
236-
'\n ⨯ ../../test/integration/server-side-dev-errors/pages/api/hello.js (2:3) @ handler'
237-
)
238222
expect(stderrOutput).toContain(
239223
' ⨯ ReferenceError: missingVar is not defined' +
240224
'\n at handler (../../test/integration/server-side-dev-errors/pages/api/hello.js:2:2)' +
@@ -287,10 +271,6 @@ describe('server-side dev errors', () => {
287271
const stderrOutput = stripAnsi(stderr.slice(stderrIdx)).trim()
288272
// FIXME(veil): error repeated
289273
if (isTurbopack) {
290-
expect(stderrOutput).toStartWith(
291-
' ⨯ ../../test/integration/server-side-dev-errors/pages/api/blog/[slug].js (2:3) @ handler' +
292-
'\n ⨯ ../../test/integration/server-side-dev-errors/pages/api/blog/[slug].js (2:3) @ handler'
293-
)
294274
expect(stderrOutput).toContain(
295275
' ⨯ ReferenceError: missingVar is not defined' +
296276
'\n at handler (../../test/integration/server-side-dev-errors/pages/api/blog/[slug].js:2:2)' +

0 commit comments

Comments
 (0)