Skip to content

Commit 2885568

Browse files
committed
Turbopack build: Fix node-file-trace test
1 parent 64e4ba7 commit 2885568

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

test/production/pages-dir/production/fixture/pages/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import Link from 'next/link?loaderQuery'
22

33
if (typeof window === 'undefined') {
44
try {
5-
let file = 'clear.js'
6-
require('es5-ext/array/#/' + file)
5+
let file = 'index.js'
6+
require('es5-ext/array/of/' + file)
77
} catch (_) {}
88
import('nanoid').then((mod) => console.log(mod.nanoid()))
99
}

test/production/pages-dir/production/test/index.test.ts

+10-4
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ describe('Production Usage', () => {
216216
/node_modules\/next/,
217217
/node_modules\/nanoid\/index\.js/,
218218
/node_modules\/nanoid\/url-alphabet\/index\.js/,
219-
/node_modules\/es5-ext\/array\/#\/clear\.js/,
219+
/node_modules\/es5-ext\/array\/of\/index\.js/,
220220
],
221221
notTests: [/next\/dist\/pages\/_error\.js/, /\0/, /\?/, /!/],
222222
},
@@ -256,7 +256,10 @@ describe('Production Usage', () => {
256256
},
257257
{
258258
page: '/api/readfile-dirname',
259-
tests: [/webpack-api-runtime\.js/, /static\/data\/item\.txt/],
259+
tests: [
260+
/(webpack-runtime\.js|\[turbopack\]_runtime\.js)/,
261+
/static\/data\/item\.txt/,
262+
],
260263
notTests: [
261264
/next\/dist\/server\/next\.js/,
262265
/next\/dist\/bin/,
@@ -267,7 +270,10 @@ describe('Production Usage', () => {
267270
},
268271
{
269272
page: '/api/readfile-processcwd',
270-
tests: [/webpack-api-runtime\.js/, /static\/data\/item\.txt/],
273+
tests: [
274+
/(webpack-runtime\.js|\[turbopack\]_runtime\.js)/,
275+
/static\/data\/item\.txt/,
276+
],
271277
notTests: [
272278
/next\/dist\/server\/next\.js/,
273279
/next\/dist\/bin/,
@@ -291,7 +297,7 @@ describe('Production Usage', () => {
291297
if (files.some((file) => item.test(file))) {
292298
return true
293299
}
294-
console.error(
300+
require('console').error(
295301
`Failed to find ${item} for page ${check.page} in`,
296302
files
297303
)

test/turbopack-build-tests-manifest.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -18501,9 +18501,10 @@
1850118501
"Production Usage should remove placeholder for next/image correctly",
1850218502
"Production Usage should replace static pages with HTML files",
1850318503
"Production Usage should respond with 405 for POST to static page",
18504-
"Production Usage should warn when prefetch is true"
18504+
"Production Usage should warn when prefetch is true",
18505+
"Production Usage should output traces"
1850518506
],
18506-
"failed": ["Production Usage should output traces"],
18507+
"failed": [],
1850718508
"pending": [
1850818509
"Production Usage With Security Related Issues should handle invalid URL properly",
1850918510
"Production Usage With basic usage should allow etag header support with getServerSideProps",

0 commit comments

Comments
 (0)