Unverified Commit 2cf8e6c8 authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

More Turbopack fixes (#56275)

Skips additional production-only tests.

Follow-up to https://github.com/vercel/next.js/pull/56089

<!-- 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 #

-->
parent e043e1f1
...@@ -2,7 +2,10 @@ import { createNext } from 'e2e-utils' ...@@ -2,7 +2,10 @@ import { createNext } from 'e2e-utils'
import { NextInstance } from 'test/lib/next-modes/base' import { NextInstance } from 'test/lib/next-modes/base'
import { renderViaHTTP } from 'next-test-utils' import { renderViaHTTP } from 'next-test-utils'
describe('webpack-issuer-deprecation-warning', () => { // Skip on Turbopack because it's not supported
;(process.env.TURBOPACK ? describe.skip : describe)(
'webpack-issuer-deprecation-warning',
() => {
let next: NextInstance let next: NextInstance
beforeAll(async () => { beforeAll(async () => {
...@@ -26,4 +29,5 @@ describe('webpack-issuer-deprecation-warning', () => { ...@@ -26,4 +29,5 @@ describe('webpack-issuer-deprecation-warning', () => {
'[DEP_WEBPACK_MODULE_ISSUER] DeprecationWarning: Module.issuer: Use new ModuleGraph API' '[DEP_WEBPACK_MODULE_ISSUER] DeprecationWarning: Module.issuer: Use new ModuleGraph API'
) )
}) })
}) }
)
...@@ -7,6 +7,7 @@ import { join } from 'path' ...@@ -7,6 +7,7 @@ import { join } from 'path'
const fixturesDir = join(__dirname, '../fixtures') const fixturesDir = join(__dirname, '../fixtures')
describe('Browserslist: Old', () => { describe('Browserslist: Old', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
const appDir = join(fixturesDir, 'browsers-old') const appDir = join(fixturesDir, 'browsers-old')
let stdout let stdout
...@@ -32,13 +33,17 @@ describe('Browserslist: Old', () => { ...@@ -32,13 +33,17 @@ describe('Browserslist: Old', () => {
expect(cssFiles.length).toBe(1) expect(cssFiles.length).toBe(1)
const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8') const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot( expect(
cssContent.replace(/\/\*.*?\*\//g, '').trim()
).toMatchInlineSnapshot(
`"a{-webkit-animation:none 0s ease 0s 1 normal none running;animation:none 0s ease 0s 1 normal none running;-webkit-backface-visibility:visible;backface-visibility:visible;background:transparent none repeat 0 0/auto auto padding-box border-box scroll;border:none;border-collapse:separate;-webkit-border-image:none;border-image:none;-webkit-border-radius:0;border-radius:0;border-spacing:0;bottom:auto;-webkit-box-shadow:none;box-shadow:none;-webkit-box-sizing:content-box;box-sizing:content-box;caption-side:top;clear:none;clip:auto;color:#000;-webkit-columns:auto;-webkit-column-count:auto;-webkit-column-fill:balance;column-fill:balance;-webkit-column-gap:normal;column-gap:normal;-webkit-column-rule:medium none currentColor;column-rule:medium none currentColor;-webkit-column-span:1;column-span:1;-webkit-column-width:auto;columns:auto;content:normal;counter-increment:none;counter-reset:none;cursor:auto;direction:ltr;display:inline;empty-cells:show;float:none;font-family:serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;line-height:normal;height:auto;-ms-hyphens:none;hyphens:none;left:auto;letter-spacing:normal;list-style:disc none outside;margin:0;max-height:none;max-width:none;min-height:0;min-width:0;opacity:1;orphans:2;outline:medium none invert;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;-webkit-perspective:none;perspective:none;-webkit-perspective-origin:50% 50%;perspective-origin:50% 50%;position:static;right:auto;tab-size:8;table-layout:auto;text-align:left;text-align-last:auto;text-decoration:none;text-indent:0;text-shadow:none;text-transform:none;top:auto;-webkit-transform:none;transform:none;-webkit-transform-origin:50% 50% 0;transform-origin:50% 50% 0;-webkit-transform-style:flat;transform-style:flat;-webkit-transition:none 0s ease 0s;transition:none 0s ease 0s;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:2;width:auto;word-spacing:normal;z-index:auto;all:initial}@media (-webkit-min-device-pixel-ratio:2),(min-resolution:2dppx){.image{background-image:url(data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)}}"` `"a{-webkit-animation:none 0s ease 0s 1 normal none running;animation:none 0s ease 0s 1 normal none running;-webkit-backface-visibility:visible;backface-visibility:visible;background:transparent none repeat 0 0/auto auto padding-box border-box scroll;border:none;border-collapse:separate;-webkit-border-image:none;border-image:none;-webkit-border-radius:0;border-radius:0;border-spacing:0;bottom:auto;-webkit-box-shadow:none;box-shadow:none;-webkit-box-sizing:content-box;box-sizing:content-box;caption-side:top;clear:none;clip:auto;color:#000;-webkit-columns:auto;-webkit-column-count:auto;-webkit-column-fill:balance;column-fill:balance;-webkit-column-gap:normal;column-gap:normal;-webkit-column-rule:medium none currentColor;column-rule:medium none currentColor;-webkit-column-span:1;column-span:1;-webkit-column-width:auto;columns:auto;content:normal;counter-increment:none;counter-reset:none;cursor:auto;direction:ltr;display:inline;empty-cells:show;float:none;font-family:serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;line-height:normal;height:auto;-ms-hyphens:none;hyphens:none;left:auto;letter-spacing:normal;list-style:disc none outside;margin:0;max-height:none;max-width:none;min-height:0;min-width:0;opacity:1;orphans:2;outline:medium none invert;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;-webkit-perspective:none;perspective:none;-webkit-perspective-origin:50% 50%;perspective-origin:50% 50%;position:static;right:auto;tab-size:8;table-layout:auto;text-align:left;text-align-last:auto;text-decoration:none;text-indent:0;text-shadow:none;text-transform:none;top:auto;-webkit-transform:none;transform:none;-webkit-transform-origin:50% 50% 0;transform-origin:50% 50% 0;-webkit-transform-style:flat;transform-style:flat;-webkit-transition:none 0s ease 0s;transition:none 0s ease 0s;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:2;width:auto;word-spacing:normal;z-index:auto;all:initial}@media (-webkit-min-device-pixel-ratio:2),(min-resolution:2dppx){.image{background-image:url(data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)}}"`
) )
}) })
})
}) })
describe('Browserslist: New', () => { describe('Browserslist: New', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
const appDir = join(fixturesDir, 'browsers-new') const appDir = join(fixturesDir, 'browsers-new')
let stdout let stdout
...@@ -64,8 +69,11 @@ describe('Browserslist: New', () => { ...@@ -64,8 +69,11 @@ describe('Browserslist: New', () => {
expect(cssFiles.length).toBe(1) expect(cssFiles.length).toBe(1)
const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8') const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot( expect(
cssContent.replace(/\/\*.*?\*\//g, '').trim()
).toMatchInlineSnapshot(
`"a{all:initial}@media (min-resolution:2dppx){.image{background-image:url(data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)}}"` `"a{all:initial}@media (min-resolution:2dppx){.image{background-image:url(data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)}}"`
) )
}) })
})
}) })
...@@ -7,6 +7,7 @@ import { join } from 'path' ...@@ -7,6 +7,7 @@ import { join } from 'path'
const fixturesDir = join(__dirname, '../fixtures') const fixturesDir = join(__dirname, '../fixtures')
describe('Custom Properties: Fail for :root {} in CSS Modules', () => { describe('Custom Properties: Fail for :root {} in CSS Modules', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
const appDir = join(fixturesDir, 'cp-global-modules') const appDir = join(fixturesDir, 'cp-global-modules')
beforeAll(async () => { beforeAll(async () => {
...@@ -22,9 +23,11 @@ describe('Custom Properties: Fail for :root {} in CSS Modules', () => { ...@@ -22,9 +23,11 @@ describe('Custom Properties: Fail for :root {} in CSS Modules', () => {
expect(stderr).toContain('pages/styles.module.css') expect(stderr).toContain('pages/styles.module.css')
expect(stderr).toContain('Selector ":root" is not pure') expect(stderr).toContain('Selector ":root" is not pure')
}) })
})
}) })
describe('Custom Properties: Fail for global element in CSS Modules', () => { describe('Custom Properties: Fail for global element in CSS Modules', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
const appDir = join(fixturesDir, 'cp-el-modules') const appDir = join(fixturesDir, 'cp-el-modules')
beforeAll(async () => { beforeAll(async () => {
...@@ -40,9 +43,11 @@ describe('Custom Properties: Fail for global element in CSS Modules', () => { ...@@ -40,9 +43,11 @@ describe('Custom Properties: Fail for global element in CSS Modules', () => {
expect(stderr).toContain('pages/styles.module.css') expect(stderr).toContain('pages/styles.module.css')
expect(stderr).toContain('Selector "h1" is not pure') expect(stderr).toContain('Selector "h1" is not pure')
}) })
})
}) })
describe('CSS Modules: Import Global CSS', () => { describe('CSS Modules: Import Global CSS', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
const appDir = join(fixturesDir, 'module-import-global') const appDir = join(fixturesDir, 'module-import-global')
let stdout let stdout
...@@ -68,13 +73,15 @@ describe('CSS Modules: Import Global CSS', () => { ...@@ -68,13 +73,15 @@ describe('CSS Modules: Import Global CSS', () => {
expect(cssFiles.length).toBe(1) expect(cssFiles.length).toBe(1)
const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8') const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot( expect(
`"a .styles_foo__G5630{all:initial}"` cssContent.replace(/\/\*.*?\*\//g, '').trim()
) ).toMatchInlineSnapshot(`"a .styles_foo__G5630{all:initial}"`)
})
}) })
}) })
describe('CSS Modules: Importing Invalid Global CSS', () => { describe('CSS Modules: Importing Invalid Global CSS', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
const appDir = join(fixturesDir, 'module-import-global-invalid') const appDir = join(fixturesDir, 'module-import-global-invalid')
beforeAll(async () => { beforeAll(async () => {
...@@ -90,9 +97,11 @@ describe('CSS Modules: Importing Invalid Global CSS', () => { ...@@ -90,9 +97,11 @@ describe('CSS Modules: Importing Invalid Global CSS', () => {
expect(stderr).toContain('pages/styles.css') expect(stderr).toContain('pages/styles.css')
expect(stderr).toContain('Selector "a" is not pure') expect(stderr).toContain('Selector "a" is not pure')
}) })
})
}) })
describe('CSS Modules: Import Exports', () => { describe('CSS Modules: Import Exports', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
const appDir = join(fixturesDir, 'module-import-exports') const appDir = join(fixturesDir, 'module-import-exports')
let stdout let stdout
...@@ -118,8 +127,9 @@ describe('CSS Modules: Import Exports', () => { ...@@ -118,8 +127,9 @@ describe('CSS Modules: Import Exports', () => {
expect(cssFiles.length).toBe(1) expect(cssFiles.length).toBe(1)
const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8') const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot( expect(
`".styles_blk__480DC{color:#000}"` cssContent.replace(/\/\*.*?\*\//g, '').trim()
) ).toMatchInlineSnapshot(`".styles_blk__480DC{color:#000}"`)
})
}) })
}) })
...@@ -7,6 +7,7 @@ import { join } from 'path' ...@@ -7,6 +7,7 @@ import { join } from 'path'
const fixturesDir = join(__dirname, '../fixtures') const fixturesDir = join(__dirname, '../fixtures')
describe('Custom Properties: Pass-Through IE11', () => { describe('Custom Properties: Pass-Through IE11', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
const appDir = join(fixturesDir, 'cp-ie-11') const appDir = join(fixturesDir, 'cp-ie-11')
let stdout let stdout
...@@ -32,13 +33,15 @@ describe('Custom Properties: Pass-Through IE11', () => { ...@@ -32,13 +33,15 @@ describe('Custom Properties: Pass-Through IE11', () => {
expect(cssFiles.length).toBe(1) expect(cssFiles.length).toBe(1)
const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8') const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot( expect(
`":root{--color:red}h1{color:var(--color)}"` cssContent.replace(/\/\*.*?\*\//g, '').trim()
) ).toMatchInlineSnapshot(`":root{--color:red}h1{color:var(--color)}"`)
})
}) })
}) })
describe('Custom Properties: Pass-Through Modern', () => { describe('Custom Properties: Pass-Through Modern', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
const appDir = join(fixturesDir, 'cp-modern') const appDir = join(fixturesDir, 'cp-modern')
let stdout let stdout
...@@ -64,13 +67,15 @@ describe('Custom Properties: Pass-Through Modern', () => { ...@@ -64,13 +67,15 @@ describe('Custom Properties: Pass-Through Modern', () => {
expect(cssFiles.length).toBe(1) expect(cssFiles.length).toBe(1)
const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8') const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot( expect(
`":root{--color:red}h1{color:var(--color)}"` cssContent.replace(/\/\*.*?\*\//g, '').trim()
) ).toMatchInlineSnapshot(`":root{--color:red}h1{color:var(--color)}"`)
})
}) })
}) })
describe('Inline Comments: Minify', () => { describe('Inline Comments: Minify', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
const appDir = join(fixturesDir, 'inline-comments') const appDir = join(fixturesDir, 'inline-comments')
let stdout let stdout
...@@ -96,8 +101,9 @@ describe('Inline Comments: Minify', () => { ...@@ -96,8 +101,9 @@ describe('Inline Comments: Minify', () => {
expect(cssFiles.length).toBe(1) expect(cssFiles.length).toBe(1)
const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8') const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot( expect(
`"*{box-sizing:border-box}"` cssContent.replace(/\/\*.*?\*\//g, '').trim()
) ).toMatchInlineSnapshot(`"*{box-sizing:border-box}"`)
})
}) })
}) })
...@@ -7,6 +7,7 @@ import { join } from 'path' ...@@ -7,6 +7,7 @@ import { join } from 'path'
const fixturesDir = join(__dirname, '../..', 'css-fixtures') const fixturesDir = join(__dirname, '../..', 'css-fixtures')
describe('Invalid CSS in _document', () => { describe('Invalid CSS in _document', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
const appDir = join(fixturesDir, 'invalid-module-document') const appDir = join(fixturesDir, 'invalid-module-document')
beforeAll(async () => { beforeAll(async () => {
...@@ -25,9 +26,11 @@ describe('Invalid CSS in _document', () => { ...@@ -25,9 +26,11 @@ describe('Invalid CSS in _document', () => {
) )
expect(stderr).toMatch(/Location:.*pages[\\/]_document\.js/) expect(stderr).toMatch(/Location:.*pages[\\/]_document\.js/)
}) })
})
}) })
describe('Invalid Global CSS', () => { describe('Invalid Global CSS', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
const appDir = join(fixturesDir, 'invalid-global') const appDir = join(fixturesDir, 'invalid-global')
beforeAll(async () => { beforeAll(async () => {
...@@ -46,9 +49,11 @@ describe('Invalid Global CSS', () => { ...@@ -46,9 +49,11 @@ describe('Invalid Global CSS', () => {
) )
expect(stderr).toMatch(/Location:.*pages[\\/]index\.js/) expect(stderr).toMatch(/Location:.*pages[\\/]index\.js/)
}) })
})
}) })
describe('Valid Global CSS from npm', () => { describe('Valid Global CSS from npm', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
const appDir = join(fixturesDir, 'import-global-from-module') const appDir = join(fixturesDir, 'import-global-from-module')
beforeAll(async () => { beforeAll(async () => {
...@@ -71,13 +76,15 @@ describe('Valid Global CSS from npm', () => { ...@@ -71,13 +76,15 @@ describe('Valid Global CSS from npm', () => {
expect(cssFiles.length).toBe(1) expect(cssFiles.length).toBe(1)
const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8') const cssContent = await readFile(join(cssFolder, cssFiles[0]), 'utf8')
expect(cssContent.replace(/\/\*.*?\*\//g, '').trim()).toMatchInlineSnapshot( expect(
`".red-text{color:\\"red\\"}"` cssContent.replace(/\/\*.*?\*\//g, '').trim()
) ).toMatchInlineSnapshot(`".red-text{color:\\"red\\"}"`)
})
}) })
}) })
describe('Invalid Global CSS with Custom App', () => { describe('Invalid Global CSS with Custom App', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
const appDir = join(fixturesDir, 'invalid-global-with-app') const appDir = join(fixturesDir, 'invalid-global-with-app')
beforeAll(async () => { beforeAll(async () => {
...@@ -96,9 +103,11 @@ describe('Invalid Global CSS with Custom App', () => { ...@@ -96,9 +103,11 @@ describe('Invalid Global CSS with Custom App', () => {
) )
expect(stderr).toMatch(/Location:.*pages[\\/]index\.js/) expect(stderr).toMatch(/Location:.*pages[\\/]index\.js/)
}) })
})
}) })
describe('Valid and Invalid Global CSS with Custom App', () => { describe('Valid and Invalid Global CSS with Custom App', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
const appDir = join(fixturesDir, 'valid-and-invalid-global') const appDir = join(fixturesDir, 'valid-and-invalid-global')
beforeAll(async () => { beforeAll(async () => {
...@@ -115,4 +124,5 @@ describe('Valid and Invalid Global CSS with Custom App', () => { ...@@ -115,4 +124,5 @@ describe('Valid and Invalid Global CSS with Custom App', () => {
expect(stderr).toContain('Please move all first-party global CSS imports') expect(stderr).toContain('Please move all first-party global CSS imports')
expect(stderr).toMatch(/Location:.*pages[\\/]index\.js/) expect(stderr).toMatch(/Location:.*pages[\\/]index\.js/)
}) })
})
}) })
...@@ -5,7 +5,10 @@ import { nextBuild } from 'next-test-utils' ...@@ -5,7 +5,10 @@ import { nextBuild } from 'next-test-utils'
const appDir = join(__dirname, '..') const appDir = join(__dirname, '..')
describe('Reports stack trace when webpack plugin stack overflows', () => { // This test is skipped because it's not relevant to Turbopack.
;(process.env.TURBOPACK ? describe.skip : describe)(
'Reports stack trace when webpack plugin stack overflows',
() => {
it('shows details in next build', async () => { it('shows details in next build', async () => {
const { code, stderr } = await nextBuild(appDir, undefined, { const { code, stderr } = await nextBuild(appDir, undefined, {
stderr: true, stderr: true,
...@@ -18,4 +21,5 @@ describe('Reports stack trace when webpack plugin stack overflows', () => { ...@@ -18,4 +21,5 @@ describe('Reports stack trace when webpack plugin stack overflows', () => {
expect(stderr).toContain('Maximum call stack size exceeded') expect(stderr).toContain('Maximum call stack size exceeded')
expect(stderr).toContain('next.config.js:7') expect(stderr).toContain('next.config.js:7')
}) })
}) }
)
...@@ -11,6 +11,7 @@ const nextConfig = new File(join(appDir, 'next.config.js')) ...@@ -11,6 +11,7 @@ const nextConfig = new File(join(appDir, 'next.config.js'))
const pagesIndexJs = new File(join(appDir, 'pages', 'index.js')) const pagesIndexJs = new File(join(appDir, 'pages', 'index.js'))
describe('Export with cloudinary loader next/image component', () => { describe('Export with cloudinary loader next/image component', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextConfig.replace( await nextConfig.replace(
'{ /* replaceme */ }', '{ /* replaceme */ }',
...@@ -42,9 +43,11 @@ describe('Export with cloudinary loader next/image component', () => { ...@@ -42,9 +43,11 @@ describe('Export with cloudinary loader next/image component', () => {
afterAll(async () => { afterAll(async () => {
await nextConfig.restore() await nextConfig.restore()
}) })
})
}) })
describe('Export with custom loader next/image component', () => { describe('Export with custom loader next/image component', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextConfig.replace( await nextConfig.replace(
'{ /* replaceme */ }', '{ /* replaceme */ }',
...@@ -80,9 +83,11 @@ describe('Export with custom loader next/image component', () => { ...@@ -80,9 +83,11 @@ describe('Export with custom loader next/image component', () => {
await nextConfig.restore() await nextConfig.restore()
await pagesIndexJs.restore() await pagesIndexJs.restore()
}) })
})
}) })
describe('Export with custom loader config but no loader prop on next/image', () => { describe('Export with custom loader config but no loader prop on next/image', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextConfig.replace( await nextConfig.replace(
'{ /* replaceme */ }', '{ /* replaceme */ }',
...@@ -106,9 +111,11 @@ describe('Export with custom loader config but no loader prop on next/image', () ...@@ -106,9 +111,11 @@ describe('Export with custom loader config but no loader prop on next/image', ()
await nextConfig.restore() await nextConfig.restore()
await pagesIndexJs.restore() await pagesIndexJs.restore()
}) })
})
}) })
describe('Export with loaderFile config next/image component', () => { describe('Export with loaderFile config next/image component', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextConfig.replace( await nextConfig.replace(
'{ /* replaceme */ }', '{ /* replaceme */ }',
...@@ -141,9 +148,11 @@ describe('Export with loaderFile config next/image component', () => { ...@@ -141,9 +148,11 @@ describe('Export with loaderFile config next/image component', () => {
await nextConfig.restore() await nextConfig.restore()
await pagesIndexJs.restore() await pagesIndexJs.restore()
}) })
})
}) })
describe('Export with unoptimized next/image component', () => { describe('Export with unoptimized next/image component', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextConfig.replace( await nextConfig.replace(
'{ /* replaceme */ }', '{ /* replaceme */ }',
...@@ -174,4 +183,5 @@ describe('Export with unoptimized next/image component', () => { ...@@ -174,4 +183,5 @@ describe('Export with unoptimized next/image component', () => {
afterAll(async () => { afterAll(async () => {
await nextConfig.restore() await nextConfig.restore()
}) })
})
}) })
...@@ -8,6 +8,7 @@ import fs from 'fs' ...@@ -8,6 +8,7 @@ import fs from 'fs'
const fixturesDir = join(__dirname, '..', 'fixtures') const fixturesDir = join(__dirname, '..', 'fixtures')
describe('Application Export Intent Output', () => { describe('Application Export Intent Output', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
describe('Default Export', () => { describe('Default Export', () => {
const appDir = join(fixturesDir, 'default-export') const appDir = join(fixturesDir, 'default-export')
const distDir = join(appDir, '.next') const distDir = join(appDir, '.next')
...@@ -23,7 +24,9 @@ describe('Application Export Intent Output', () => { ...@@ -23,7 +24,9 @@ describe('Application Export Intent Output', () => {
it('should have the expected outputs for export', () => { it('should have the expected outputs for export', () => {
expect( expect(
JSON.parse(fs.readFileSync(join(distDir, 'export-marker.json'), 'utf8')) JSON.parse(
fs.readFileSync(join(distDir, 'export-marker.json'), 'utf8')
)
).toMatchInlineSnapshot(` ).toMatchInlineSnapshot(`
Object { Object {
"exportTrailingSlash": false, "exportTrailingSlash": false,
...@@ -48,8 +51,12 @@ describe('Application Export Intent Output', () => { ...@@ -48,8 +51,12 @@ describe('Application Export Intent Output', () => {
`) `)
}) })
}) })
})
describe('Custom Export', () => { describe('Custom Export', () => {
;(process.env.TURBOPACK ? describe.skip : describe)(
'production mode',
() => {
const appDir = join(fixturesDir, 'custom-export') const appDir = join(fixturesDir, 'custom-export')
const distDir = join(appDir, '.next') const distDir = join(appDir, '.next')
...@@ -64,7 +71,9 @@ describe('Application Export Intent Output', () => { ...@@ -64,7 +71,9 @@ describe('Application Export Intent Output', () => {
it('should have the expected outputs for export', () => { it('should have the expected outputs for export', () => {
expect( expect(
JSON.parse(fs.readFileSync(join(distDir, 'export-marker.json'), 'utf8')) JSON.parse(
fs.readFileSync(join(distDir, 'export-marker.json'), 'utf8')
)
).toMatchInlineSnapshot(` ).toMatchInlineSnapshot(`
Object { Object {
"exportTrailingSlash": false, "exportTrailingSlash": false,
...@@ -88,9 +97,14 @@ describe('Application Export Intent Output', () => { ...@@ -88,9 +97,14 @@ describe('Application Export Intent Output', () => {
} }
`) `)
}) })
}
)
}) })
describe('Custom Out', () => { describe('Custom Out', () => {
;(process.env.TURBOPACK ? describe.skip : describe)(
'production mode',
() => {
const appDir = join(fixturesDir, 'custom-out') const appDir = join(fixturesDir, 'custom-out')
const distDir = join(appDir, '.next') const distDir = join(appDir, '.next')
...@@ -105,7 +119,9 @@ describe('Application Export Intent Output', () => { ...@@ -105,7 +119,9 @@ describe('Application Export Intent Output', () => {
it('should have the expected outputs for export', () => { it('should have the expected outputs for export', () => {
expect( expect(
JSON.parse(fs.readFileSync(join(distDir, 'export-marker.json'), 'utf8')) JSON.parse(
fs.readFileSync(join(distDir, 'export-marker.json'), 'utf8')
)
).toMatchInlineSnapshot(` ).toMatchInlineSnapshot(`
Object { Object {
"exportTrailingSlash": true, "exportTrailingSlash": true,
...@@ -129,9 +145,14 @@ describe('Application Export Intent Output', () => { ...@@ -129,9 +145,14 @@ describe('Application Export Intent Output', () => {
} }
`) `)
}) })
}
)
}) })
describe('Bad Export', () => { describe('Bad Export', () => {
;(process.env.TURBOPACK ? describe.skip : describe)(
'production mode',
() => {
const appDir = join(fixturesDir, 'bad-export') const appDir = join(fixturesDir, 'bad-export')
const distDir = join(appDir, '.next') const distDir = join(appDir, '.next')
...@@ -146,7 +167,9 @@ describe('Application Export Intent Output', () => { ...@@ -146,7 +167,9 @@ describe('Application Export Intent Output', () => {
it('should have the expected outputs for export', () => { it('should have the expected outputs for export', () => {
expect( expect(
JSON.parse(fs.readFileSync(join(distDir, 'export-marker.json'), 'utf8')) JSON.parse(
fs.readFileSync(join(distDir, 'export-marker.json'), 'utf8')
)
).toMatchInlineSnapshot(` ).toMatchInlineSnapshot(`
Object { Object {
"exportTrailingSlash": false, "exportTrailingSlash": false,
...@@ -170,9 +193,14 @@ describe('Application Export Intent Output', () => { ...@@ -170,9 +193,14 @@ describe('Application Export Intent Output', () => {
} }
`) `)
}) })
}
)
}) })
describe('No Export', () => { describe('No Export', () => {
;(process.env.TURBOPACK ? describe.skip : describe)(
'production mode',
() => {
const appDir = join(fixturesDir, 'no-export') const appDir = join(fixturesDir, 'no-export')
const distDir = join(appDir, '.next') const distDir = join(appDir, '.next')
...@@ -186,7 +214,9 @@ describe('Application Export Intent Output', () => { ...@@ -186,7 +214,9 @@ describe('Application Export Intent Output', () => {
it('should have the expected outputs for export', () => { it('should have the expected outputs for export', () => {
expect( expect(
JSON.parse(fs.readFileSync(join(distDir, 'export-marker.json'), 'utf8')) JSON.parse(
fs.readFileSync(join(distDir, 'export-marker.json'), 'utf8')
)
).toMatchInlineSnapshot(` ).toMatchInlineSnapshot(`
Object { Object {
"exportTrailingSlash": false, "exportTrailingSlash": false,
...@@ -216,5 +246,7 @@ describe('Application Export Intent Output', () => { ...@@ -216,5 +246,7 @@ describe('Application Export Intent Output', () => {
fs.readFileSync(join(distDir, 'export-detail.json'), 'utf8') fs.readFileSync(join(distDir, 'export-detail.json'), 'utf8')
}).toThrowError(/ENOENT/) }).toThrowError(/ENOENT/)
}) })
}
)
}) })
}) })
...@@ -15,6 +15,7 @@ let appPort ...@@ -15,6 +15,7 @@ let appPort
let app let app
describe("Handle ESM externals with esmExternals: 'loose'", () => { describe("Handle ESM externals with esmExternals: 'loose'", () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await fs.remove(join(appDir, '.next')) await fs.remove(join(appDir, '.next'))
await nextBuild(appDir) await nextBuild(appDir)
...@@ -40,4 +41,5 @@ describe("Handle ESM externals with esmExternals: 'loose'", () => { ...@@ -40,4 +41,5 @@ describe("Handle ESM externals with esmExternals: 'loose'", () => {
const html = await renderViaHTTP(appPort, '/ssg') const html = await renderViaHTTP(appPort, '/ssg')
expect(html).toMatch(expected) expect(html).toMatch(expected)
}) })
})
}) })
...@@ -15,6 +15,7 @@ let appPort ...@@ -15,6 +15,7 @@ let appPort
let app let app
describe('Handle ESM externals with esmExternals: true', () => { describe('Handle ESM externals with esmExternals: true', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await fs.remove(join(appDir, '.next')) await fs.remove(join(appDir, '.next'))
await nextBuild(appDir) await nextBuild(appDir)
...@@ -40,4 +41,5 @@ describe('Handle ESM externals with esmExternals: true', () => { ...@@ -40,4 +41,5 @@ describe('Handle ESM externals with esmExternals: true', () => {
const html = await renderViaHTTP(appPort, '/ssg') const html = await renderViaHTTP(appPort, '/ssg')
expect(html).toMatch(expected) expect(html).toMatch(expected)
}) })
})
}) })
...@@ -13,6 +13,7 @@ const writePage = async (content, testPage = join(pagesDir, 'test.js')) => { ...@@ -13,6 +13,7 @@ const writePage = async (content, testPage = join(pagesDir, 'test.js')) => {
} }
describe('GSP build errors', () => { describe('GSP build errors', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
afterEach(() => fs.remove(pagesDir)) afterEach(() => fs.remove(pagesDir))
it('should fail build from module not found', async () => { it('should fail build from module not found', async () => {
...@@ -166,4 +167,5 @@ describe('GSP build errors', () => { ...@@ -166,4 +167,5 @@ describe('GSP build errors', () => {
expect(code).toBe(1) expect(code).toBe(1)
expect(stderr).toContain('my custom error') expect(stderr).toContain('my custom error')
}) })
})
}) })
...@@ -107,7 +107,7 @@ const runTests = () => { ...@@ -107,7 +107,7 @@ const runTests = () => {
}) })
} }
describe('Custom routes i18n', () => { describe('Custom routes i18n custom error', () => {
describe('dev mode', () => { describe('dev mode', () => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
......
...@@ -75,7 +75,7 @@ const runTests = () => { ...@@ -75,7 +75,7 @@ const runTests = () => {
}) })
} }
describe('Custom routes i18n', () => { describe('Custom routes i18n support index rewrite', () => {
describe('dev mode', () => { describe('dev mode', () => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
......
...@@ -89,6 +89,7 @@ const runTests = (isDev = false) => { ...@@ -89,6 +89,7 @@ const runTests = (isDev = false) => {
} }
describe('Build Error Tests for basePath', () => { describe('Build Error Tests for basePath', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
it('should throw build error when import statement is used with missing file', async () => { it('should throw build error when import statement is used with missing file', async () => {
await indexPage.replace( await indexPage.replace(
'../public/foo/test-rect.jpg', '../public/foo/test-rect.jpg',
...@@ -104,6 +105,7 @@ describe('Build Error Tests for basePath', () => { ...@@ -104,6 +105,7 @@ describe('Build Error Tests for basePath', () => {
// should contain the importing module // should contain the importing module
expect(stderr).toContain('./pages/static-img.js') expect(stderr).toContain('./pages/static-img.js')
}) })
})
}) })
describe('Static Image Component Tests for basePath', () => { describe('Static Image Component Tests for basePath', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
......
...@@ -99,6 +99,7 @@ const runTests = () => { ...@@ -99,6 +99,7 @@ const runTests = () => {
} }
describe('Build Error Tests', () => { describe('Build Error Tests', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
it('should throw build error when import statement is used with missing file', async () => { it('should throw build error when import statement is used with missing file', async () => {
await indexPage.replace( await indexPage.replace(
'../public/foo/test-rect.jpg', '../public/foo/test-rect.jpg',
...@@ -116,8 +117,10 @@ describe('Build Error Tests', () => { ...@@ -116,8 +117,10 @@ describe('Build Error Tests', () => {
// should contain a import trace // should contain a import trace
expect(stderr).not.toContain('Import trace for requested module') expect(stderr).not.toContain('Import trace for requested module')
}) })
})
}) })
describe('Static Image Component Tests', () => { describe('Static Image Component Tests', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await nextBuild(appDir) await nextBuild(appDir)
appPort = await findPort() appPort = await findPort()
...@@ -129,4 +132,5 @@ describe('Static Image Component Tests', () => { ...@@ -129,4 +132,5 @@ describe('Static Image Component Tests', () => {
killApp(app) killApp(app)
}) })
runTests() runTests()
})
}) })
...@@ -186,6 +186,7 @@ const runTests = (isDev) => { ...@@ -186,6 +186,7 @@ const runTests = (isDev) => {
} }
describe('Build Error Tests', () => { describe('Build Error Tests', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
it('should throw build error when import statement is used with missing file', async () => { it('should throw build error when import statement is used with missing file', async () => {
await indexPage.replace( await indexPage.replace(
'../../public/foo/test-rect.jpg', '../../public/foo/test-rect.jpg',
...@@ -203,6 +204,7 @@ describe('Build Error Tests', () => { ...@@ -203,6 +204,7 @@ describe('Build Error Tests', () => {
// should contain a import trace // should contain a import trace
expect(stderr).not.toContain('Import trace for requested module') expect(stderr).not.toContain('Import trace for requested module')
}) })
})
}) })
describe('Static Image Component Tests', () => { describe('Static Image Component Tests', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
......
...@@ -144,6 +144,7 @@ const runTests = (isDev) => { ...@@ -144,6 +144,7 @@ const runTests = (isDev) => {
} }
describe('Build Error Tests', () => { describe('Build Error Tests', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
it('should throw build error when import statement is used with missing file', async () => { it('should throw build error when import statement is used with missing file', async () => {
await indexPage.replace( await indexPage.replace(
'../public/foo/test-rect.jpg', '../public/foo/test-rect.jpg',
...@@ -161,6 +162,7 @@ describe('Build Error Tests', () => { ...@@ -161,6 +162,7 @@ describe('Build Error Tests', () => {
// should contain a import trace // should contain a import trace
expect(stderr).not.toContain('Import trace for requested module') expect(stderr).not.toContain('Import trace for requested module')
}) })
})
}) })
describe('Static Image Component Tests for basePath', () => { describe('Static Image Component Tests for basePath', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
......
...@@ -198,6 +198,7 @@ const runTests = (isDev) => { ...@@ -198,6 +198,7 @@ const runTests = (isDev) => {
} }
describe('Build Error Tests', () => { describe('Build Error Tests', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
it('should throw build error when import statement is used with missing file', async () => { it('should throw build error when import statement is used with missing file', async () => {
await indexPage.replace( await indexPage.replace(
'../public/foo/test-rect.jpg', '../public/foo/test-rect.jpg',
...@@ -215,6 +216,7 @@ describe('Build Error Tests', () => { ...@@ -215,6 +216,7 @@ describe('Build Error Tests', () => {
// should contain a import trace // should contain a import trace
expect(stderr).not.toContain('Import trace for requested module') expect(stderr).not.toContain('Import trace for requested module')
}) })
})
}) })
describe('Static Image Component Tests', () => { describe('Static Image Component Tests', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
......
...@@ -15,6 +15,7 @@ const addPage = async (page, content) => { ...@@ -15,6 +15,7 @@ const addPage = async (page, content) => {
} }
describe('no-op export', () => { describe('no-op export', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
afterEach(async () => { afterEach(async () => {
await Promise.all( await Promise.all(
['.next', 'pages', 'next.config.js', 'out'].map((file) => ['.next', 'pages', 'next.config.js', 'out'].map((file) =>
...@@ -98,4 +99,5 @@ describe('no-op export', () => { ...@@ -98,4 +99,5 @@ describe('no-op export', () => {
}) })
expect(exportResult.code).toBe(0) expect(exportResult.code).toBe(0)
}) })
})
}) })
...@@ -28,7 +28,8 @@ const startServer = async (optEnv = {}, opts) => { ...@@ -28,7 +28,8 @@ const startServer = async (optEnv = {}, opts) => {
context.server = await initNextServerScript(scriptPath, /ready on/i, env) context.server = await initNextServerScript(scriptPath, /ready on/i, env)
} }
describe('On Demand Entries', () => { // Tests are skipped in Turbopack because they are not relevant to Turbopack.
;(process.env.TURBOPACK ? describe.skip : describe)('On Demand Entries', () => {
it('should pass', () => {}) it('should pass', () => {})
beforeAll(async () => { beforeAll(async () => {
await startServer() await startServer()
......
...@@ -7,6 +7,7 @@ import { join } from 'path' ...@@ -7,6 +7,7 @@ import { join } from 'path'
const appDir = join(__dirname, '../') const appDir = join(__dirname, '../')
describe('Polyfilling (minimal)', () => { describe('Polyfilling (minimal)', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => { beforeAll(async () => {
await remove(join(appDir, '.next')) await remove(join(appDir, '.next'))
}) })
...@@ -18,4 +19,5 @@ describe('Polyfilling (minimal)', () => { ...@@ -18,4 +19,5 @@ describe('Polyfilling (minimal)', () => {
expect(code).toBe(0) expect(code).toBe(0)
expect(stdout).toMatch(/Compiled successfully/) expect(stdout).toMatch(/Compiled successfully/)
}) })
})
}) })
...@@ -10,6 +10,7 @@ let appPort ...@@ -10,6 +10,7 @@ let appPort
let app let app
describe('Polyfills', () => { describe('Polyfills', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
let output = '' let output = ''
beforeAll(async () => { beforeAll(async () => {
...@@ -51,4 +52,5 @@ describe('Polyfills', () => { ...@@ -51,4 +52,5 @@ describe('Polyfills', () => {
// we should only have 1 segment and the initial message logged out // we should only have 1 segment and the initial message logged out
expect(output.match(/Generating static pages/g).length).toBe(5) expect(output.match(/Generating static pages/g).length).toBe(5)
}) })
})
}) })
...@@ -7,7 +7,8 @@ import { join } from 'path' ...@@ -7,7 +7,8 @@ import { join } from 'path'
const fixturesDir = join(__dirname, '../..', 'scss-fixtures') const fixturesDir = join(__dirname, '../..', 'scss-fixtures')
describe('Invalid CSS in _document', () => { describe('Invalid SCSS in _document', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
const appDir = join(fixturesDir, 'invalid-module-document') const appDir = join(fixturesDir, 'invalid-module-document')
beforeAll(async () => { beforeAll(async () => {
...@@ -26,9 +27,11 @@ describe('Invalid CSS in _document', () => { ...@@ -26,9 +27,11 @@ describe('Invalid CSS in _document', () => {
) )
expect(stderr).toMatch(/Location:.*pages[\\/]_document\.js/) expect(stderr).toMatch(/Location:.*pages[\\/]_document\.js/)
}) })
})
}) })
describe('Invalid Global CSS', () => { describe('Invalid Global CSS', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
const appDir = join(fixturesDir, 'invalid-global') const appDir = join(fixturesDir, 'invalid-global')
beforeAll(async () => { beforeAll(async () => {
...@@ -47,9 +50,11 @@ describe('Invalid Global CSS', () => { ...@@ -47,9 +50,11 @@ describe('Invalid Global CSS', () => {
) )
expect(stderr).toMatch(/Location:.*pages[\\/]index\.js/) expect(stderr).toMatch(/Location:.*pages[\\/]index\.js/)
}) })
})
}) })
describe('Invalid Global CSS with Custom App', () => { describe('Invalid Global CSS with Custom App', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
const appDir = join(fixturesDir, 'invalid-global-with-app') const appDir = join(fixturesDir, 'invalid-global-with-app')
beforeAll(async () => { beforeAll(async () => {
...@@ -68,9 +73,11 @@ describe('Invalid Global CSS with Custom App', () => { ...@@ -68,9 +73,11 @@ describe('Invalid Global CSS with Custom App', () => {
) )
expect(stderr).toMatch(/Location:.*pages[\\/]index\.js/) expect(stderr).toMatch(/Location:.*pages[\\/]index\.js/)
}) })
})
}) })
describe('Valid and Invalid Global CSS with Custom App', () => { describe('Valid and Invalid Global CSS with Custom App', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
const appDir = join(fixturesDir, 'valid-and-invalid-global') const appDir = join(fixturesDir, 'valid-and-invalid-global')
beforeAll(async () => { beforeAll(async () => {
...@@ -87,4 +94,5 @@ describe('Valid and Invalid Global CSS with Custom App', () => { ...@@ -87,4 +94,5 @@ describe('Valid and Invalid Global CSS with Custom App', () => {
expect(stderr).toContain('Please move all first-party global CSS imports') expect(stderr).toContain('Please move all first-party global CSS imports')
expect(stderr).toMatch(/Location:.*pages[\\/]index\.js/) expect(stderr).toMatch(/Location:.*pages[\\/]index\.js/)
}) })
})
}) })
...@@ -65,7 +65,9 @@ describe('turbopack unsupported features log', () => { ...@@ -65,7 +65,9 @@ describe('turbopack unsupported features log', () => {
await fs.writeFile( await fs.writeFile(
nextConfigPath, nextConfigPath,
`module.exports = { `module.exports = {
assetPrefix: '/idk' experimental: {
urlImports: true
}
}` }`
) )
const appPort = await findPort() const appPort = await findPort()
...@@ -91,6 +93,6 @@ describe('turbopack unsupported features log', () => { ...@@ -91,6 +93,6 @@ describe('turbopack unsupported features log', () => {
} }
}) })
} else { } else {
it.skip('turobpack only', () => {}) it.skip('turbopack only', () => {})
} }
}) })
...@@ -3,10 +3,14 @@ import { nextBuild } from 'next-test-utils' ...@@ -3,10 +3,14 @@ import { nextBuild } from 'next-test-utils'
const appDir = join(__dirname, '../') const appDir = join(__dirname, '../')
describe('webpack config with extensionAlias setting', () => { // Skip webpack specific test in Turbopack
;(process.env.TURBOPACK ? describe.skip : describe)(
'webpack config with extensionAlias setting',
() => {
it('should run correctly with an tsx file import with .js extension', async () => { it('should run correctly with an tsx file import with .js extension', async () => {
const { code } = await nextBuild(appDir, [], {}) const { code } = await nextBuild(appDir, [], {})
expect(code).toBe(0) expect(code).toBe(0)
}) })
}) }
)
...@@ -996,7 +996,9 @@ export function runProdSuite( ...@@ -996,7 +996,9 @@ export function runProdSuite(
env?: NodeJS.ProcessEnv env?: NodeJS.ProcessEnv
} }
) { ) {
return runSuite(suiteName, { appDir, env: 'prod' }, options) ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
runSuite(suiteName, { appDir, env: 'prod' }, options)
})
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment