Unverified Commit 69f5fb26 authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Skip test/integration development tests during Turbopack build test run (#63671)

## What?

Follow-up to #63665.

Ensures development tests are skipped during the production build run
for Turbopack (i.e. used to create the turbopack-build-tests-manifest).

Adds `pnpm test-dev-turbo` and `pnpm test-start-turbo` (and their
`testonly` equivalent) for running tests.

<!-- 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-2915
parent 9677c87e
...@@ -15,10 +15,14 @@ ...@@ -15,10 +15,14 @@
"test-types": "tsc", "test-types": "tsc",
"test-unit": "jest test/unit/ packages/next/ packages/font", "test-unit": "jest test/unit/ packages/next/ packages/font",
"test-dev": "cross-env NEXT_TEST_MODE=dev pnpm testheadless", "test-dev": "cross-env NEXT_TEST_MODE=dev pnpm testheadless",
"test-dev-turbo": "cross-env NEXT_TEST_MODE=dev TURBOPACK=1 TURBOPACK_DEV=1 pnpm testheadless",
"test-start": "cross-env NEXT_TEST_MODE=start pnpm testheadless", "test-start": "cross-env NEXT_TEST_MODE=start pnpm testheadless",
"test-start-turbo": "cross-env NEXT_TEST_MODE=start TURBOPACK=1 TURBOPACK_BUILD=1 pnpm testheadless",
"test-deploy": "cross-env NEXT_TEST_MODE=deploy pnpm testheadless", "test-deploy": "cross-env NEXT_TEST_MODE=deploy pnpm testheadless",
"testonly-dev": "cross-env NEXT_TEST_MODE=dev pnpm testonly", "testonly-dev": "cross-env NEXT_TEST_MODE=dev pnpm testonly",
"testonly-dev-turbo": "cross-env NEXT_TEST_MODE=dev TURBOPACK=1 TURBOPACK_DEV=1 pnpm testonly",
"testonly-start": "cross-env NEXT_TEST_MODE=start pnpm testonly", "testonly-start": "cross-env NEXT_TEST_MODE=start pnpm testonly",
"testonly-start-turbo": "cross-env NEXT_TEST_MODE=start TURBOPACK=1 TURBOPACK_BUILD=1 pnpm testonly",
"testonly-deploy": "cross-env NEXT_TEST_MODE=deploy pnpm testonly", "testonly-deploy": "cross-env NEXT_TEST_MODE=deploy pnpm testonly",
"test": "pnpm testheadless", "test": "pnpm testheadless",
"testonly": "jest --runInBand", "testonly": "jest --runInBand",
......
...@@ -61,8 +61,9 @@ describe('404 Page Support with _app', () => { ...@@ -61,8 +61,9 @@ describe('404 Page Support with _app', () => {
}) })
} }
) )
;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
describe('development mode', () => { 'development mode',
() => {
let stderr = '' let stderr = ''
let stdout = '' let stdout = ''
...@@ -87,5 +88,6 @@ describe('404 Page Support with _app', () => { ...@@ -87,5 +88,6 @@ describe('404 Page Support with _app', () => {
expect(stderr).not.toMatch(gip404Err) expect(stderr).not.toMatch(gip404Err)
expect(stdout).not.toMatch(gip404Err) expect(stdout).not.toMatch(gip404Err)
}) })
}) }
)
}) })
...@@ -72,8 +72,9 @@ describe('Default 404 Page with custom _error', () => { ...@@ -72,8 +72,9 @@ describe('Default 404 Page with custom _error', () => {
runTests('server') runTests('server')
} }
) )
;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
describe('development mode', () => { 'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -81,5 +82,6 @@ describe('Default 404 Page with custom _error', () => { ...@@ -81,5 +82,6 @@ describe('Default 404 Page with custom _error', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests('dev') runTests('dev')
}) }
)
}) })
...@@ -113,8 +113,9 @@ describe('404 Page Support SSG', () => { ...@@ -113,8 +113,9 @@ describe('404 Page Support SSG', () => {
runTests() runTests()
} }
) )
;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
describe('development mode', () => { 'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
stderr = '' stderr = ''
...@@ -131,5 +132,6 @@ describe('404 Page Support SSG', () => { ...@@ -131,5 +132,6 @@ describe('404 Page Support SSG', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests(true) runTests(true)
}) }
)
}) })
...@@ -70,7 +70,9 @@ const runTests = (mode = 'server') => { ...@@ -70,7 +70,9 @@ const runTests = (mode = 'server') => {
} }
describe('404 Page Support', () => { describe('404 Page Support', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -78,7 +80,8 @@ describe('404 Page Support', () => { ...@@ -78,7 +80,8 @@ describe('404 Page Support', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests('dev') runTests('dev')
}) }
)
describe('development mode 2', () => { describe('development mode 2', () => {
it('falls back to _error correctly without pages/404', async () => { it('falls back to _error correctly without pages/404', async () => {
await fs.move(pages404, `${pages404}.bak`) await fs.move(pages404, `${pages404}.bak`)
......
...@@ -183,8 +183,9 @@ describe('gsp-gssp', () => { ...@@ -183,8 +183,9 @@ describe('gsp-gssp', () => {
}) })
} }
) )
;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
describe('development mode', () => { 'development mode',
() => {
it('does not show error with getStaticProps in pages/500 dev', async () => { it('does not show error with getStaticProps in pages/500 dev', async () => {
await fs.move(pages500, `${pages500}.bak`) await fs.move(pages500, `${pages500}.bak`)
await fs.writeFile( await fs.writeFile(
...@@ -242,5 +243,6 @@ describe('gsp-gssp', () => { ...@@ -242,5 +243,6 @@ describe('gsp-gssp', () => {
expect(stderr).toMatch(gip500Err) expect(stderr).toMatch(gip500Err)
}) })
}) }
)
}) })
...@@ -60,7 +60,9 @@ const runTests = (mode = 'server') => { ...@@ -60,7 +60,9 @@ const runTests = (mode = 'server') => {
} }
describe('500 Page Support', () => { describe('500 Page Support', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
await fs.remove(join(appDir, '.next')) await fs.remove(join(appDir, '.next'))
appPort = await findPort() appPort = await findPort()
...@@ -69,7 +71,8 @@ describe('500 Page Support', () => { ...@@ -69,7 +71,8 @@ describe('500 Page Support', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests('dev') runTests('dev')
}) }
)
describe('development mode 2', () => { describe('development mode 2', () => {
it('shows error with getInitialProps in pages/500 dev', async () => { it('shows error with getInitialProps in pages/500 dev', async () => {
await fs.move(pages500, `${pages500}.bak`) await fs.move(pages500, `${pages500}.bak`)
......
...@@ -35,8 +35,9 @@ const appDir = join(__dirname, '../') ...@@ -35,8 +35,9 @@ const appDir = join(__dirname, '../')
}) })
} }
) )
;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
describe('development mode', () => { 'development mode',
() => {
it('should run in development mode successfully', async () => { it('should run in development mode successfully', async () => {
let stderr = '' let stderr = ''
...@@ -53,6 +54,7 @@ const appDir = join(__dirname, '../') ...@@ -53,6 +54,7 @@ const appDir = join(__dirname, '../')
expect(stderr).not.toContain('error') expect(stderr).not.toContain('error')
expect(html).toContain('Hello from AMP') expect(html).toContain('Hello from AMP')
}) })
}) }
)
} }
) )
...@@ -113,14 +113,17 @@ describe('AMP SSG Support', () => { ...@@ -113,14 +113,17 @@ describe('AMP SSG Support', () => {
runTests() runTests()
} }
) )
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
}) })
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests(true) runTests(true)
}) }
)
describe('export mode', () => { describe('export mode', () => {
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
......
import { runTests } from './utils' import { runTests } from './utils'
describe('app dir - with output export - dynamic missing gsp dev', () => { describe('app dir - with output export - dynamic missing gsp dev', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
it('should error when dynamic route is missing generateStaticParams', async () => { it('should error when dynamic route is missing generateStaticParams', async () => {
await runTests({ await runTests({
isDev: true, isDev: true,
...@@ -21,5 +23,6 @@ describe('app dir - with output export - dynamic missing gsp dev', () => { ...@@ -21,5 +23,6 @@ describe('app dir - with output export - dynamic missing gsp dev', () => {
'Page "/another/[slug]/page" cannot use both "use client" and export function "generateStaticParams()".', 'Page "/another/[slug]/page" cannot use both "use client" and export function "generateStaticParams()".',
}) })
}) })
}) }
)
}) })
import { runTests } from './utils' import { runTests } from './utils'
describe('app dir - with output export - dynamic api route dev', () => { describe('app dir - with output export - dynamic api route dev', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
it.each([ it.each([
{ dynamicApiRoute: 'undefined' }, { dynamicApiRoute: 'undefined' },
{ dynamicApiRoute: "'error'" }, { dynamicApiRoute: "'error'" },
...@@ -17,5 +19,6 @@ describe('app dir - with output export - dynamic api route dev', () => { ...@@ -17,5 +19,6 @@ describe('app dir - with output export - dynamic api route dev', () => {
await runTests({ isDev: true, dynamicApiRoute, expectedErrMsg }) await runTests({ isDev: true, dynamicApiRoute, expectedErrMsg })
} }
) )
}) }
)
}) })
import { runTests } from './utils' import { runTests } from './utils'
describe('app dir - with output export - dynamic page dev', () => { describe('app dir - with output export - dynamic page dev', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
it.each([ it.each([
{ dynamicPage: 'undefined' }, { dynamicPage: 'undefined' },
{ dynamicPage: "'error'" }, { dynamicPage: "'error'" },
...@@ -17,5 +19,6 @@ describe('app dir - with output export - dynamic page dev', () => { ...@@ -17,5 +19,6 @@ describe('app dir - with output export - dynamic page dev', () => {
await runTests({ isDev: true, dynamicPage, expectedErrMsg }) await runTests({ isDev: true, dynamicPage, expectedErrMsg })
} }
) )
}) }
)
}) })
import { runTests } from './utils' import { runTests } from './utils'
describe('app dir - with output export - trailing slash dev', () => { describe('app dir - with output export - trailing slash dev', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
it.each([{ trailingSlash: false }, { trailingSlash: true }])( it.each([{ trailingSlash: false }, { trailingSlash: true }])(
"should work in dev with trailingSlash '$trailingSlash'", "should work in dev with trailingSlash '$trailingSlash'",
async ({ trailingSlash }) => { async ({ trailingSlash }) => {
await runTests({ isDev: true, trailingSlash }) await runTests({ isDev: true, trailingSlash })
} }
) )
}) }
)
}) })
...@@ -72,8 +72,9 @@ describe('Root components import order', () => { ...@@ -72,8 +72,9 @@ describe('Root components import order', () => {
} }
) )
}) })
;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
describe('development mode', () => { 'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(join(__dirname, '../'), appPort) app = await launchApp(join(__dirname, '../'), appPort)
...@@ -96,4 +97,5 @@ describe('development mode', () => { ...@@ -96,4 +97,5 @@ describe('development mode', () => {
) )
} }
) )
}) }
)
...@@ -48,14 +48,17 @@ const runTests = () => { ...@@ -48,14 +48,17 @@ const runTests = () => {
} }
describe('AppTree', () => { describe('AppTree', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
}) })
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests() runTests()
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -104,7 +104,9 @@ function runTests(dev = false) { ...@@ -104,7 +104,9 @@ function runTests(dev = false) {
} }
describe('Async modules', () => { describe('Async modules', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -114,7 +116,8 @@ describe('Async modules', () => { ...@@ -114,7 +116,8 @@ describe('Async modules', () => {
}) })
runTests(true) runTests(true)
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -33,7 +33,9 @@ const runTests = () => { ...@@ -33,7 +33,9 @@ const runTests = () => {
} }
describe('bigint API route support', () => { describe('bigint API route support', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -41,7 +43,8 @@ describe('bigint API route support', () => { ...@@ -41,7 +43,8 @@ describe('bigint API route support', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests() runTests()
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -13,7 +13,9 @@ const appDir = join(__dirname, '../') ...@@ -13,7 +13,9 @@ const appDir = join(__dirname, '../')
const errorRegex = /getStaticPaths was added without a getStaticProps in/ const errorRegex = /getStaticPaths was added without a getStaticProps in/
describe('Catches Missing getStaticProps', () => { describe('Catches Missing getStaticProps', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
it('should catch it in development mode', async () => { it('should catch it in development mode', async () => {
const appPort = await findPort() const appPort = await findPort()
const app = await launchApp(appDir, appPort) const app = await launchApp(appDir, appPort)
...@@ -22,7 +24,8 @@ describe('Catches Missing getStaticProps', () => { ...@@ -22,7 +24,8 @@ describe('Catches Missing getStaticProps', () => {
expect(html).toMatch(errorRegex) expect(html).toMatch(errorRegex)
}) })
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -23,7 +23,9 @@ const runTests = (isProd = false) => { ...@@ -23,7 +23,9 @@ const runTests = (isProd = false) => {
} }
describe('Client 404', () => { describe('Client 404', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
context.appPort = await findPort() context.appPort = await findPort()
context.server = await launchApp(appDir, context.appPort) context.server = await launchApp(appDir, context.appPort)
...@@ -34,7 +36,8 @@ describe('Client 404', () => { ...@@ -34,7 +36,8 @@ describe('Client 404', () => {
afterAll(() => killApp(context.server)) afterAll(() => killApp(context.server))
runTests() runTests()
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -88,7 +88,9 @@ const runTests = () => { ...@@ -88,7 +88,9 @@ const runTests = () => {
} }
describe('Client Shallow Routing', () => { describe('Client Shallow Routing', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -96,7 +98,8 @@ describe('Client Shallow Routing', () => { ...@@ -96,7 +98,8 @@ describe('Client Shallow Routing', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests() runTests()
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -12,7 +12,9 @@ import { ...@@ -12,7 +12,9 @@ import {
const appDir = path.join(__dirname, '..') const appDir = path.join(__dirname, '..')
describe('Errors on conflict between public file and page file', () => { describe('Errors on conflict between public file and page file', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
it('Throws error during development', async () => { it('Throws error during development', async () => {
const appPort = await findPort() const appPort = await findPort()
const app = await launchApp(appDir, appPort) const app = await launchApp(appDir, appPort)
...@@ -26,7 +28,8 @@ describe('Errors on conflict between public file and page file', () => { ...@@ -26,7 +28,8 @@ describe('Errors on conflict between public file and page file', () => {
} }
await killApp(app) await killApp(app)
}) })
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -509,7 +509,9 @@ module.exports = { ...@@ -509,7 +509,9 @@ module.exports = {
}) })
} }
describe('Development Mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
await remove(join(appDir, '.next')) await remove(join(appDir, '.next'))
}) })
...@@ -522,7 +524,8 @@ module.exports = { ...@@ -522,7 +524,8 @@ module.exports = {
}) })
tests(true) tests(true)
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -27,14 +27,17 @@ const runTests = () => { ...@@ -27,14 +27,17 @@ const runTests = () => {
} }
describe('Custom page extension', () => { describe('Custom page extension', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
}) })
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests() runTests()
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -44,7 +44,9 @@ const runTests = () => { ...@@ -44,7 +44,9 @@ const runTests = () => {
} }
describe('Custom routes', () => { describe('Custom routes', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -52,7 +54,8 @@ describe('Custom routes', () => { ...@@ -52,7 +54,8 @@ describe('Custom routes', () => {
}) })
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests(true) runTests(true)
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -60,15 +60,17 @@ describe('Custom routes i18n with index redirect', () => { ...@@ -60,15 +60,17 @@ describe('Custom routes i18n with index redirect', () => {
afterAll(async () => { afterAll(async () => {
server.close() server.close()
}) })
;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
describe('development mode', () => { 'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
}) })
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests(true) runTests(true)
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -167,15 +167,17 @@ describe('Custom routes i18n', () => { ...@@ -167,15 +167,17 @@ describe('Custom routes i18n', () => {
server.close() server.close()
nextConfig.restore() nextConfig.restore()
}) })
;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
describe('development mode', () => { 'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
}) })
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests(true) runTests(true)
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -2635,8 +2635,9 @@ describe('Custom routes', () => { ...@@ -2635,8 +2635,9 @@ describe('Custom routes', () => {
externalServer.close() externalServer.close()
await fs.writeFile(nextConfigPath, nextConfigRestoreContent) await fs.writeFile(nextConfigPath, nextConfigRestoreContent)
}) })
;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
describe('development mode', () => { 'development mode',
() => {
let nextConfigContent let nextConfigContent
beforeAll(async () => { beforeAll(async () => {
...@@ -2665,7 +2666,8 @@ describe('Custom routes', () => { ...@@ -2665,7 +2666,8 @@ describe('Custom routes', () => {
await killApp(app) await killApp(app)
}) })
runTests(true) runTests(true)
}) }
)
describe('no-op rewrite', () => { describe('no-op rewrite', () => {
beforeAll(async () => { beforeAll(async () => {
...@@ -2810,9 +2812,12 @@ describe('Custom routes', () => { ...@@ -2810,9 +2812,12 @@ describe('Custom routes', () => {
}) })
} }
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
runSoloTests(true) runSoloTests(true)
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -128,10 +128,12 @@ describe('GS(S)P Page Errors', () => { ...@@ -128,10 +128,12 @@ describe('GS(S)P Page Errors', () => {
origIndexPage = await fs.readFile(indexPage, 'utf8') origIndexPage = await fs.readFile(indexPage, 'utf8')
}) })
afterAll(() => fs.writeFile(indexPage, origIndexPage)) afterAll(() => fs.writeFile(indexPage, origIndexPage))
;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
describe('development mode', () => { 'development mode',
() => {
runTests(true) runTests(true)
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -56,8 +56,9 @@ describe('disabled runtime JS', () => { ...@@ -56,8 +56,9 @@ describe('disabled runtime JS', () => {
}) })
} }
) )
;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
describe('development mode', () => { 'development mode',
() => {
let appPort let appPort
let app let app
...@@ -68,11 +69,13 @@ describe('disabled runtime JS', () => { ...@@ -68,11 +69,13 @@ describe('disabled runtime JS', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
// eslint-disable-next-line jest/no-identical-title
it('should render the page', async () => { it('should render the page', async () => {
const html = await renderViaHTTP(appPort, '/') const html = await renderViaHTTP(appPort, '/')
expect(html).toMatch(/Hello World/) expect(html).toMatch(/Hello World/)
}) })
// eslint-disable-next-line jest/no-identical-title
it('should not have __NEXT_DATA__ script', async () => { it('should not have __NEXT_DATA__ script', async () => {
const html = await renderViaHTTP(appPort, '/') const html = await renderViaHTTP(appPort, '/')
...@@ -89,5 +92,6 @@ describe('disabled runtime JS', () => { ...@@ -89,5 +92,6 @@ describe('disabled runtime JS', () => {
expect($(`script[src="${url}"]`).length).toBe(1) expect($(`script[src="${url}"]`).length).toBe(1)
}) })
}) })
}) }
)
}) })
...@@ -47,8 +47,9 @@ describe('distDir', () => { ...@@ -47,8 +47,9 @@ describe('distDir', () => {
} }
) )
}) })
;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
describe('development mode', () => { 'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
await fs.remove(join(appDir, '.next')) await fs.remove(join(appDir, '.next'))
await fs.remove(join(appDir, 'dist')) await fs.remove(join(appDir, 'dist'))
...@@ -70,7 +71,8 @@ describe('distDir', () => { ...@@ -70,7 +71,8 @@ describe('distDir', () => {
it('should not build the app within the default `.next` directory', async () => { it('should not build the app within the default `.next` directory', async () => {
expect(await fs.exists(join(__dirname, '/../.next'))).toBeFalsy() expect(await fs.exists(join(__dirname, '/../.next'))).toBeFalsy()
}) })
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -19,8 +19,9 @@ describe('Custom Document Head Warnings', () => { ...@@ -19,8 +19,9 @@ describe('Custom Document Head Warnings', () => {
await renderViaHTTP(appPort, '/') await renderViaHTTP(appPort, '/')
await killApp(app) await killApp(app)
}) })
;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
describe('development mode', () => { 'development mode',
() => {
it('warns when using a <title> in document/head', () => { it('warns when using a <title> in document/head', () => {
expect(output).toMatch( expect(output).toMatch(
/.*Warning: <title> should not be used in _document.js's <Head>\..*/ /.*Warning: <title> should not be used in _document.js's <Head>\..*/
...@@ -38,5 +39,6 @@ describe('Custom Document Head Warnings', () => { ...@@ -38,5 +39,6 @@ describe('Custom Document Head Warnings', () => {
/.*Warning: `Head` attribute `crossOrigin` is deprecated\..*/ /.*Warning: `Head` attribute `crossOrigin` is deprecated\..*/
) )
}) })
}) }
)
}) })
...@@ -32,7 +32,9 @@ function getData(html: string) { ...@@ -32,7 +32,9 @@ function getData(html: string) {
} }
describe('Test Draft Mode', () => { describe('Test Draft Mode', () => {
describe('Development Mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
let appPort, app, browser, cookieString let appPort, app, browser, cookieString
it('should start development application', async () => { it('should start development application', async () => {
appPort = await findPort() appPort = await findPort()
...@@ -116,7 +118,8 @@ describe('Test Draft Mode', () => { ...@@ -116,7 +118,8 @@ describe('Test Draft Mode', () => {
await browser.close() await browser.close()
await killApp(app) await killApp(app)
}) })
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
...@@ -153,6 +156,7 @@ describe('Test Draft Mode', () => { ...@@ -153,6 +156,7 @@ describe('Test Draft Mode', () => {
expect(rand).toBe(initialRand) expect(rand).toBe(initialRand)
}) })
// eslint-disable-next-line jest/no-identical-title
it('should enable draft mode', async () => { it('should enable draft mode', async () => {
const res = await fetchViaHTTP(appPort, '/api/enable') const res = await fetchViaHTTP(appPort, '/api/enable')
expect(res.status).toBe(200) expect(res.status).toBe(200)
......
...@@ -51,7 +51,9 @@ function runTests() { ...@@ -51,7 +51,9 @@ function runTests() {
const nextConfig = join(appDir, 'next.config.js') const nextConfig = join(appDir, 'next.config.js')
describe('Dynamic Optional Routing Root Fallback', () => { describe('Dynamic Optional Routing Root Fallback', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
await fs.remove(join(appDir, '.next')) await fs.remove(join(appDir, '.next'))
...@@ -61,7 +63,8 @@ describe('Dynamic Optional Routing Root Fallback', () => { ...@@ -61,7 +63,8 @@ describe('Dynamic Optional Routing Root Fallback', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests() runTests()
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -39,7 +39,9 @@ function runTests() { ...@@ -39,7 +39,9 @@ function runTests() {
const nextConfig = join(appDir, 'next.config.js') const nextConfig = join(appDir, 'next.config.js')
describe('Dynamic Optional Routing', () => { describe('Dynamic Optional Routing', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -47,7 +49,8 @@ describe('Dynamic Optional Routing', () => { ...@@ -47,7 +49,8 @@ describe('Dynamic Optional Routing', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests() runTests()
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -237,7 +237,9 @@ function runInvalidPagesTests(buildFn) { ...@@ -237,7 +237,9 @@ function runInvalidPagesTests(buildFn) {
} }
describe('Dynamic Optional Routing', () => { describe('Dynamic Optional Routing', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -254,7 +256,8 @@ describe('Dynamic Optional Routing', () => { ...@@ -254,7 +256,8 @@ describe('Dynamic Optional Routing', () => {
}, },
}) })
}) })
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -1579,7 +1579,9 @@ describe('Dynamic Routing', () => { ...@@ -1579,7 +1579,9 @@ describe('Dynamic Routing', () => {
afterAll(() => fs.remove(middlewarePath)) afterAll(() => fs.remove(middlewarePath))
} }
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
await fs.remove(nextConfig) await fs.remove(nextConfig)
...@@ -1590,7 +1592,8 @@ describe('Dynamic Routing', () => { ...@@ -1590,7 +1592,8 @@ describe('Dynamic Routing', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests({ dev: true }) runTests({ dev: true })
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -74,7 +74,9 @@ describe.each([ ...@@ -74,7 +74,9 @@ describe.each([
])( ])(
'$title usage of dynamic code evaluation', '$title usage of dynamic code evaluation',
({ extractValue, computeRoute }) => { ({ extractValue, computeRoute }) => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
let output = '' let output = ''
beforeAll(async () => { beforeAll(async () => {
...@@ -157,7 +159,8 @@ describe.each([ ...@@ -157,7 +159,8 @@ describe.each([
expect(output).not.toContain(WASM_INSTANTIATE_ERROR) expect(output).not.toContain(WASM_INSTANTIATE_ERROR)
expect(output).not.toContain('DynamicWasmCodeGenerationWarning') expect(output).not.toContain('DynamicWasmCodeGenerationWarning')
}) })
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -82,8 +82,9 @@ describe('Edge runtime code with imports', () => { ...@@ -82,8 +82,9 @@ describe('Edge runtime code with imports', () => {
const importStatement = `await import("${moduleName}")` const importStatement = `await import("${moduleName}")`
beforeEach(() => init(importStatement)) beforeEach(() => init(importStatement))
;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
describe('development mode', () => { 'development mode',
() => {
it('throws unsupported module error in dev at runtime and highlights the faulty line', async () => { it('throws unsupported module error in dev at runtime and highlights the faulty line', async () => {
context.app = await launchApp( context.app = await launchApp(
context.appDir, context.appDir,
...@@ -100,7 +101,8 @@ describe('Edge runtime code with imports', () => { ...@@ -100,7 +101,8 @@ describe('Edge runtime code with imports', () => {
) )
}) })
}) })
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
...@@ -167,8 +169,9 @@ describe('Edge runtime code with imports', () => { ...@@ -167,8 +169,9 @@ describe('Edge runtime code with imports', () => {
} }
`) `)
}) })
;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
describe('development mode', () => { 'development mode',
() => {
it('throws unsupported module error in dev at runtime and highlights the faulty line', async () => { it('throws unsupported module error in dev at runtime and highlights the faulty line', async () => {
context.app = await launchApp( context.app = await launchApp(
context.appDir, context.appDir,
...@@ -186,7 +189,8 @@ describe('Edge runtime code with imports', () => { ...@@ -186,7 +189,8 @@ describe('Edge runtime code with imports', () => {
return 'success' return 'success'
}, 'success') }, 'success')
}) })
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -50,7 +50,9 @@ function createContext() { ...@@ -50,7 +50,9 @@ function createContext() {
return ctx return ctx
} }
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
const context = createContext() const context = createContext()
beforeAll(async () => { beforeAll(async () => {
...@@ -64,7 +66,8 @@ describe('development mode', () => { ...@@ -64,7 +66,8 @@ describe('development mode', () => {
afterAll(() => killApp(context.app)) afterAll(() => killApp(context.app))
it('logs the error correctly', test(context)) it('logs the error correctly', test(context))
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
...@@ -82,6 +85,7 @@ describe('development mode', () => { ...@@ -82,6 +85,7 @@ describe('development mode', () => {
}) })
}) })
afterAll(() => killApp(context.app)) afterAll(() => killApp(context.app))
// eslint-disable-next-line jest/no-identical-title
it('logs the error correctly', test(context)) it('logs the error correctly', test(context))
} }
) )
...@@ -60,7 +60,9 @@ describe.each([ ...@@ -60,7 +60,9 @@ describe.each([
])('$title using Node.js API', ({ computeRoute }) => { ])('$title using Node.js API', ({ computeRoute }) => {
const appDir = join(__dirname, '..') const appDir = join(__dirname, '..')
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
let output = '' let output = ''
let appPort: number let appPort: number
let app = null let app = null
...@@ -109,7 +111,8 @@ describe.each([ ...@@ -109,7 +111,8 @@ describe.each([
Learn more: https://nextjs.org/docs/api-reference/edge-runtime`) Learn more: https://nextjs.org/docs/api-reference/edge-runtime`)
expect(stripAnsi(output)).toInclude(errorHighlight) expect(stripAnsi(output)).toInclude(errorHighlight)
}) })
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -132,7 +132,9 @@ const runTests = (mode = 'dev', didReload = false) => { ...@@ -132,7 +132,9 @@ const runTests = (mode = 'dev', didReload = false) => {
} }
describe('Env Config', () => { describe('Env Config', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
output = '' output = ''
appPort = await findPort() appPort = await findPort()
...@@ -233,7 +235,9 @@ describe('Env Config', () => { ...@@ -233,7 +235,9 @@ describe('Env Config', () => {
html = await fetchViaHTTP(appPort, '/').then((res) => res.text()) html = await fetchViaHTTP(appPort, '/').then((res) => res.text())
renderedEnv = JSON.parse(cheerio.load(html)('p').text()) renderedEnv = JSON.parse(cheerio.load(html)('p').text())
expect(renderedEnv['ENV_FILE_KEY']).toBe('env-updated') expect(renderedEnv['ENV_FILE_KEY']).toBe('env-updated')
expect(renderedEnv['ENV_FILE_LOCAL_OVERRIDE_TEST']).toBe('localenv') expect(renderedEnv['ENV_FILE_LOCAL_OVERRIDE_TEST']).toBe(
'localenv'
)
return 'success' return 'success'
}, 'success') }, 'success')
...@@ -341,7 +345,8 @@ describe('Env Config', () => { ...@@ -341,7 +345,8 @@ describe('Env Config', () => {
} }
}) })
}) })
}) }
)
describe('test environment', () => { describe('test environment', () => {
beforeAll(async () => { beforeAll(async () => {
......
...@@ -107,7 +107,9 @@ const runTests = () => { ...@@ -107,7 +107,9 @@ const runTests = () => {
} }
describe('fallback: false rewrite', () => { describe('fallback: false rewrite', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
await fs.remove(join(appDir, '.next')) await fs.remove(join(appDir, '.next'))
appPort = await findPort() appPort = await findPort()
...@@ -116,7 +118,8 @@ describe('fallback: false rewrite', () => { ...@@ -116,7 +118,8 @@ describe('fallback: false rewrite', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests() runTests()
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -40,7 +40,9 @@ const runTests = () => { ...@@ -40,7 +40,9 @@ const runTests = () => {
} }
describe('Fallback Dynamic Route Params', () => { describe('Fallback Dynamic Route Params', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
await fs.remove(join(appDir, '.next')) await fs.remove(join(appDir, '.next'))
appPort = await findPort() appPort = await findPort()
...@@ -49,7 +51,8 @@ describe('Fallback Dynamic Route Params', () => { ...@@ -49,7 +51,8 @@ describe('Fallback Dynamic Route Params', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests() runTests()
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -51,7 +51,9 @@ function runTests() { ...@@ -51,7 +51,9 @@ function runTests() {
} }
describe('Fetch polyfill with ky-universal', () => { describe('Fetch polyfill with ky-universal', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
await startApiServer() await startApiServer()
...@@ -67,7 +69,8 @@ describe('Fetch polyfill with ky-universal', () => { ...@@ -67,7 +69,8 @@ describe('Fetch polyfill with ky-universal', () => {
}) })
runTests() runTests()
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -70,7 +70,9 @@ function runTests() { ...@@ -70,7 +70,9 @@ function runTests() {
} }
describe('Fetch polyfill', () => { describe('Fetch polyfill', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
await startApiServer() await startApiServer()
...@@ -86,7 +88,8 @@ describe('Fetch polyfill', () => { ...@@ -86,7 +88,8 @@ describe('Fetch polyfill', () => {
}) })
runTests() runTests()
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -4465,7 +4465,9 @@ const copyTestFileToDist = () => ...@@ -4465,7 +4465,9 @@ const copyTestFileToDist = () =>
fs.copy(join(appDir, 'test-file.txt'), join(appDir, '.next', 'test-file.txt')) fs.copy(join(appDir, 'test-file.txt'), join(appDir, '.next', 'test-file.txt'))
describe('File Serving', () => { describe('File Serving', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort, { app = await launchApp(appDir, appPort, {
...@@ -4481,7 +4483,8 @@ describe('File Serving', () => { ...@@ -4481,7 +4483,8 @@ describe('File Serving', () => {
}) })
runTests(true) runTests(true)
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -40,7 +40,9 @@ const runTests = () => { ...@@ -40,7 +40,9 @@ const runTests = () => {
} }
describe('getInitialProps', () => { describe('getInitialProps', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -48,7 +50,8 @@ describe('getInitialProps', () => { ...@@ -48,7 +50,8 @@ describe('getInitialProps', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests() runTests()
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -174,7 +174,9 @@ function runTests(startServer = nextStart) { ...@@ -174,7 +174,9 @@ function runTests(startServer = nextStart) {
} }
describe('ServerSide Props Preview Mode', () => { describe('ServerSide Props Preview Mode', () => {
describe('Development Mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
let appPort, app let appPort, app
it('should start development application', async () => { it('should start development application', async () => {
appPort = await findPort() appPort = await findPort()
...@@ -183,16 +185,27 @@ describe('ServerSide Props Preview Mode', () => { ...@@ -183,16 +185,27 @@ describe('ServerSide Props Preview Mode', () => {
let previewCookieString let previewCookieString
it('should enable preview mode', async () => { it('should enable preview mode', async () => {
const res = await fetchViaHTTP(appPort, '/api/preview', { lets: 'goooo' }) const res = await fetchViaHTTP(appPort, '/api/preview', {
lets: 'goooo',
})
expect(res.status).toBe(200) expect(res.status).toBe(200)
const cookies = res.headers.get('set-cookie').split(',').map(cookie.parse) const cookies = res.headers
.get('set-cookie')
.split(',')
.map(cookie.parse)
expect(cookies.length).toBe(2) expect(cookies.length).toBe(2)
previewCookieString = previewCookieString =
cookie.serialize('__prerender_bypass', cookies[0].__prerender_bypass) + cookie.serialize(
'__prerender_bypass',
cookies[0].__prerender_bypass
) +
'; ' + '; ' +
cookie.serialize('__next_preview_data', cookies[1].__next_preview_data) cookie.serialize(
'__next_preview_data',
cookies[1].__next_preview_data
)
}) })
it('should return cookies to be expired after dev server reboot', async () => { it('should return cookies to be expired after dev server reboot', async () => {
...@@ -268,7 +281,8 @@ describe('ServerSide Props Preview Mode', () => { ...@@ -268,7 +281,8 @@ describe('ServerSide Props Preview Mode', () => {
await browser.close() await browser.close()
await killApp(app) await killApp(app)
}) })
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -87,9 +87,12 @@ const runTests = (isDev) => { ...@@ -87,9 +87,12 @@ const runTests = (isDev) => {
} }
describe('gip identifiers', () => { describe('gip identifiers', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
runTests(true) runTests(true)
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -31,7 +31,9 @@ const runTests = () => { ...@@ -31,7 +31,9 @@ const runTests = () => {
} }
describe('pageProps GSSP conflict', () => { describe('pageProps GSSP conflict', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -39,7 +41,8 @@ describe('pageProps GSSP conflict', () => { ...@@ -39,7 +41,8 @@ describe('pageProps GSSP conflict', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests() runTests()
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -480,7 +480,9 @@ const runTests = (isDev) => { ...@@ -480,7 +480,9 @@ const runTests = (isDev) => {
} }
describe('GS(S)P Redirect Support', () => { describe('GS(S)P Redirect Support', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -488,7 +490,8 @@ describe('GS(S)P Redirect Support', () => { ...@@ -488,7 +490,8 @@ describe('GS(S)P Redirect Support', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests(true) runTests(true)
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -505,7 +505,9 @@ const runTests = (isDev) => { ...@@ -505,7 +505,9 @@ const runTests = (isDev) => {
} }
describe('GS(S)P Redirect Support', () => { describe('GS(S)P Redirect Support', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -513,7 +515,8 @@ describe('GS(S)P Redirect Support', () => { ...@@ -513,7 +515,8 @@ describe('GS(S)P Redirect Support', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests(true) runTests(true)
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -37,7 +37,9 @@ function runTests() { ...@@ -37,7 +37,9 @@ function runTests() {
const nextConfig = join(appDir, 'next.config.js') const nextConfig = join(appDir, 'next.config.js')
describe('Hashbang', () => { describe('Hashbang', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -45,7 +47,8 @@ describe('Hashbang', () => { ...@@ -45,7 +47,8 @@ describe('Hashbang', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests(true) runTests(true)
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -40,7 +40,9 @@ const runTests = () => { ...@@ -40,7 +40,9 @@ const runTests = () => {
} }
describe('Hydration', () => { describe('Hydration', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
await fs.remove(path.join(appDir, '.next')) await fs.remove(path.join(appDir, '.next'))
appPort = await findPort() appPort = await findPort()
...@@ -49,7 +51,8 @@ describe('Hydration', () => { ...@@ -49,7 +51,8 @@ describe('Hydration', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests() runTests()
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -40,8 +40,9 @@ describe('i18n Support basePath', () => { ...@@ -40,8 +40,9 @@ describe('i18n Support basePath', () => {
}) })
) )
}) })
;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
describe('development mode', () => { 'development mode',
() => {
const curCtx = { const curCtx = {
...ctx, ...ctx,
isDev: true, isDev: true,
...@@ -58,7 +59,8 @@ describe('i18n Support basePath', () => { ...@@ -58,7 +59,8 @@ describe('i18n Support basePath', () => {
}) })
runTests(curCtx) runTests(curCtx)
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -221,7 +221,9 @@ function runTests(isDev) { ...@@ -221,7 +221,9 @@ function runTests(isDev) {
} }
describe('i18n Support Root Catch-all', () => { describe('i18n Support Root Catch-all', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
await fs.remove(join(appDir, '.next')) await fs.remove(join(appDir, '.next'))
appPort = await findPort() appPort = await findPort()
...@@ -230,7 +232,8 @@ describe('i18n Support Root Catch-all', () => { ...@@ -230,7 +232,8 @@ describe('i18n Support Root Catch-all', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests(true) runTests(true)
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -108,14 +108,17 @@ const runTests = () => { ...@@ -108,14 +108,17 @@ const runTests = () => {
} }
describe('Custom routes i18n custom error', () => { describe('Custom routes i18n custom error', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
}) })
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests(true) runTests(true)
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -85,7 +85,9 @@ function runTests() { ...@@ -85,7 +85,9 @@ function runTests() {
} }
describe('i18n Support', () => { describe('i18n Support', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
await fs.remove(join(appDir, '.next')) await fs.remove(join(appDir, '.next'))
appPort = await findPort() appPort = await findPort()
...@@ -97,7 +99,8 @@ describe('i18n Support', () => { ...@@ -97,7 +99,8 @@ describe('i18n Support', () => {
}) })
runTests() runTests()
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -85,7 +85,9 @@ function runTests() { ...@@ -85,7 +85,9 @@ function runTests() {
} }
describe('i18n Support', () => { describe('i18n Support', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
await fs.remove(join(appDir, '.next')) await fs.remove(join(appDir, '.next'))
appPort = await findPort() appPort = await findPort()
...@@ -97,7 +99,8 @@ describe('i18n Support', () => { ...@@ -97,7 +99,8 @@ describe('i18n Support', () => {
}) })
runTests() runTests()
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -76,14 +76,17 @@ const runTests = () => { ...@@ -76,14 +76,17 @@ const runTests = () => {
} }
describe('Custom routes i18n support index rewrite', () => { describe('Custom routes i18n support index rewrite', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
}) })
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests(true) runTests(true)
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -71,14 +71,17 @@ const runTests = () => { ...@@ -71,14 +71,17 @@ const runTests = () => {
} }
describe('Hash changes i18n', () => { describe('Hash changes i18n', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
}) })
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests(true) runTests(true)
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -38,8 +38,9 @@ describe('i18n Support', () => { ...@@ -38,8 +38,9 @@ describe('i18n Support', () => {
}) })
}) })
afterAll(() => ctx.externalApp.close()) afterAll(() => ctx.externalApp.close())
;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
describe('development mode', () => { 'development mode',
() => {
const curCtx = { const curCtx = {
...ctx, ...ctx,
isDev: true, isDev: true,
...@@ -57,7 +58,8 @@ describe('i18n Support', () => { ...@@ -57,7 +58,8 @@ describe('i18n Support', () => {
}) })
runTests(curCtx) runTests(curCtx)
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
...@@ -421,7 +423,9 @@ describe('i18n Support', () => { ...@@ -421,7 +423,9 @@ describe('i18n Support', () => {
}) })
} }
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
const curCtx = { const curCtx = {
...ctx, ...ctx,
isDev: true, isDev: true,
...@@ -439,7 +443,8 @@ describe('i18n Support', () => { ...@@ -439,7 +443,8 @@ describe('i18n Support', () => {
}) })
runSlashTests(curCtx) runSlashTests(curCtx)
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
...@@ -488,7 +493,9 @@ describe('i18n Support', () => { ...@@ -488,7 +493,9 @@ describe('i18n Support', () => {
}) })
} }
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
const curCtx = { const curCtx = {
...ctx, ...ctx,
isDev: true, isDev: true,
...@@ -506,7 +513,8 @@ describe('i18n Support', () => { ...@@ -506,7 +513,8 @@ describe('i18n Support', () => {
}) })
runSlashTests(curCtx) runSlashTests(curCtx)
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -182,7 +182,9 @@ function runTests() { ...@@ -182,7 +182,9 @@ function runTests() {
const nextConfig = join(appDir, 'next.config.js') const nextConfig = join(appDir, 'next.config.js')
describe('nested index.js', () => { describe('nested index.js', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -190,7 +192,8 @@ describe('nested index.js', () => { ...@@ -190,7 +192,8 @@ describe('nested index.js', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests() runTests()
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -35,8 +35,9 @@ describe('Initial Refs', () => { ...@@ -35,8 +35,9 @@ describe('Initial Refs', () => {
runTest() runTest()
} }
) )
;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
describe('development mode', () => { 'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -44,5 +45,6 @@ describe('Initial Refs', () => { ...@@ -44,5 +45,6 @@ describe('Initial Refs', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTest() runTest()
}) }
)
}) })
...@@ -578,8 +578,9 @@ const runTests = () => { ...@@ -578,8 +578,9 @@ const runTests = () => {
describe('Errors on invalid custom routes', () => { describe('Errors on invalid custom routes', () => {
afterAll(() => fs.remove(nextConfigPath)) afterAll(() => fs.remove(nextConfigPath))
;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
describe('development mode', () => { 'development mode',
() => {
let stderr = '' let stderr = ''
beforeAll(() => { beforeAll(() => {
getStderr = async () => { getStderr = async () => {
...@@ -597,7 +598,8 @@ describe('Errors on invalid custom routes', () => { ...@@ -597,7 +598,8 @@ describe('Errors on invalid custom routes', () => {
}) })
runTests() runTests()
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -147,8 +147,9 @@ describe('Invalid hrefs', () => { ...@@ -147,8 +147,9 @@ describe('Invalid hrefs', () => {
}) })
} }
) )
;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
describe('development mode', () => { 'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -163,6 +164,7 @@ describe('Invalid hrefs', () => { ...@@ -163,6 +164,7 @@ describe('Invalid hrefs', () => {
await noError('/second') await noError('/second')
}) })
// eslint-disable-next-line jest/no-identical-title
it('shows error when dynamic route mismatch is used on Link', async () => { it('shows error when dynamic route mismatch is used on Link', async () => {
await showsError( await showsError(
'/dynamic-route-mismatch', '/dynamic-route-mismatch',
...@@ -183,6 +185,7 @@ describe('Invalid hrefs', () => { ...@@ -183,6 +185,7 @@ describe('Invalid hrefs', () => {
await noError('/dynamic-route-mismatch-manual', true) await noError('/dynamic-route-mismatch-manual', true)
}) })
// eslint-disable-next-line jest/no-identical-title
it("doesn't fail on invalid url", async () => { it("doesn't fail on invalid url", async () => {
await noError('/third') await noError('/third')
}) })
...@@ -195,5 +198,6 @@ describe('Invalid hrefs', () => { ...@@ -195,5 +198,6 @@ describe('Invalid hrefs', () => {
true true
) )
}) })
}) }
)
}) })
...@@ -135,8 +135,9 @@ const runTests = () => { ...@@ -135,8 +135,9 @@ const runTests = () => {
describe('Errors on invalid custom middleware matchers', () => { describe('Errors on invalid custom middleware matchers', () => {
afterAll(() => fs.remove(middlewarePath)) afterAll(() => fs.remove(middlewarePath))
;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
describe('development mode', () => { 'development mode',
() => {
beforeAll(() => { beforeAll(() => {
getStderr = async () => { getStderr = async () => {
let stderr = '' let stderr = ''
...@@ -152,7 +153,8 @@ describe('Errors on invalid custom middleware matchers', () => { ...@@ -152,7 +153,8 @@ describe('Errors on invalid custom middleware matchers', () => {
}) })
runTests() runTests()
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -28,7 +28,9 @@ const runTests = () => { ...@@ -28,7 +28,9 @@ const runTests = () => {
} }
describe('Custom routes invalid multi-match', () => { describe('Custom routes invalid multi-match', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort, { app = await launchApp(appDir, appPort, {
...@@ -39,7 +41,8 @@ describe('Custom routes invalid multi-match', () => { ...@@ -39,7 +41,8 @@ describe('Custom routes invalid multi-match', () => {
}) })
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests(true) runTests(true)
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -58,7 +58,9 @@ function runCommonTests() { ...@@ -58,7 +58,9 @@ function runCommonTests() {
} }
describe('Invalid hrefs', () => { describe('Invalid hrefs', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -82,7 +84,8 @@ describe('Invalid hrefs', () => { ...@@ -82,7 +84,8 @@ describe('Invalid hrefs', () => {
it('should handle child ref that is a function', async () => { it('should handle child ref that is a function', async () => {
await noError('/child-ref-func') await noError('/child-ref-func')
}) })
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -21,8 +21,9 @@ describe('Link without a router', () => { ...@@ -21,8 +21,9 @@ describe('Link without a router', () => {
container.remove() container.remove()
container = null container = null
}) })
;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
describe('development mode', () => { 'development mode',
() => {
it('should not throw when rendered', () => { it('should not throw when rendered', () => {
jest.useFakeTimers() jest.useFakeTimers()
...@@ -36,10 +37,12 @@ describe('Link without a router', () => { ...@@ -36,10 +37,12 @@ describe('Link without a router', () => {
expect(container.textContent).toBe('Click me') expect(container.textContent).toBe('Click me')
}) })
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
// eslint-disable-next-line jest/no-identical-title
it('should not throw when rendered', () => { it('should not throw when rendered', () => {
jest.useFakeTimers() jest.useFakeTimers()
......
...@@ -23,7 +23,9 @@ function runTest() { ...@@ -23,7 +23,9 @@ function runTest() {
}) })
} }
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -31,7 +33,8 @@ describe('development mode', () => { ...@@ -31,7 +33,8 @@ describe('development mode', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTest() runTest()
}) }
)
// TODO enable that once turbopack supports middleware in development mode // TODO enable that once turbopack supports middleware in development mode
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
......
...@@ -14,7 +14,9 @@ const context = { appDir: join(__dirname, '../'), appPort: NaN, app: null } ...@@ -14,7 +14,9 @@ const context = { appDir: join(__dirname, '../'), appPort: NaN, app: null }
jest.setTimeout(1000 * 60 * 2) jest.setTimeout(1000 * 60 * 2)
describe('Middleware overriding a Node.js API', () => { describe('Middleware overriding a Node.js API', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
let output = '' let output = ''
beforeAll(async () => { beforeAll(async () => {
...@@ -41,5 +43,6 @@ describe('Middleware overriding a Node.js API', () => { ...@@ -41,5 +43,6 @@ describe('Middleware overriding a Node.js API', () => {
expect(output).not.toContain('A Node.js API is used (process.env') expect(output).not.toContain('A Node.js API is used (process.env')
expect(output).not.toContain('A Node.js API is used (process.cwd') expect(output).not.toContain('A Node.js API is used (process.cwd')
}) })
}) }
)
}) })
...@@ -89,8 +89,9 @@ describe.each([ ...@@ -89,8 +89,9 @@ describe.each([
])('$title', ({ setup, teardown, runTest }) => { ])('$title', ({ setup, teardown, runTest }) => {
beforeAll(() => setup()) beforeAll(() => setup())
afterAll(() => teardown()) afterAll(() => teardown())
;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
describe('development mode', () => { 'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -98,7 +99,8 @@ describe.each([ ...@@ -98,7 +99,8 @@ describe.each([
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTest() runTest()
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -31,7 +31,9 @@ function runTests() { ...@@ -31,7 +31,9 @@ function runTests() {
} }
describe('next/dynamic', () => { describe('next/dynamic', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -39,7 +41,8 @@ describe('next/dynamic', () => { ...@@ -39,7 +41,8 @@ describe('next/dynamic', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests(true) runTests(true)
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -50,7 +50,9 @@ function runTests() { ...@@ -50,7 +50,9 @@ function runTests() {
;(process.env.TURBOPACK ? describe.skip : describe)( ;(process.env.TURBOPACK ? describe.skip : describe)(
'next/dynamic lazy compilation', 'next/dynamic lazy compilation',
() => { () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -58,7 +60,8 @@ function runTests() { ...@@ -58,7 +60,8 @@ function runTests() {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests(true) runTests(true)
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -43,7 +43,9 @@ function runTests() { ...@@ -43,7 +43,9 @@ function runTests() {
} }
describe('next/dynamic', () => { describe('next/dynamic', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -51,7 +53,8 @@ describe('next/dynamic', () => { ...@@ -51,7 +53,8 @@ describe('next/dynamic', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests(true) runTests(true)
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -16,7 +16,9 @@ let appPort ...@@ -16,7 +16,9 @@ let appPort
let app let app
describe('Image Component assetPrefix Tests', () => { describe('Image Component assetPrefix Tests', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -44,7 +46,8 @@ describe('Image Component assetPrefix Tests', () => { ...@@ -44,7 +46,8 @@ describe('Image Component assetPrefix Tests', () => {
} }
} }
}) })
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -465,7 +465,9 @@ function runTests(mode) { ...@@ -465,7 +465,9 @@ function runTests(mode) {
} }
describe('Image Component basePath Tests', () => { describe('Image Component basePath Tests', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -473,7 +475,8 @@ describe('Image Component basePath Tests', () => { ...@@ -473,7 +475,8 @@ describe('Image Component basePath Tests', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests('dev') runTests('dev')
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -139,8 +139,9 @@ describe('Static Image Component Tests for basePath', () => { ...@@ -139,8 +139,9 @@ describe('Static Image Component Tests for basePath', () => {
runTests() runTests()
} }
) )
;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
describe('development mode', () => { 'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -151,5 +152,6 @@ describe('Static Image Component Tests for basePath', () => { ...@@ -151,5 +152,6 @@ describe('Static Image Component Tests for basePath', () => {
killApp(app) killApp(app)
}) })
runTests(true) runTests(true)
}) }
)
}) })
...@@ -1469,7 +1469,9 @@ function runTests(mode) { ...@@ -1469,7 +1469,9 @@ function runTests(mode) {
} }
describe('Image Component Tests', () => { describe('Image Component Tests', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -1479,7 +1481,8 @@ describe('Image Component Tests', () => { ...@@ -1479,7 +1481,8 @@ describe('Image Component Tests', () => {
}) })
runTests('dev') runTests('dev')
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -31,8 +31,9 @@ let devOutput ...@@ -31,8 +31,9 @@ let devOutput
}) })
} }
) )
;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
describe('development mode', () => { 'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
devOutput = { stdout: '', stderr: '' } devOutput = { stdout: '', stderr: '' }
appPort = await findPort() appPort = await findPort()
...@@ -51,6 +52,7 @@ let devOutput ...@@ -51,6 +52,7 @@ let devOutput
await renderViaHTTP(appPort, '/', {}) await renderViaHTTP(appPort, '/', {})
expect(devOutput.stderr).toBeFalsy() expect(devOutput.stderr).toBeFalsy()
}) })
}) }
)
} }
) )
...@@ -17,7 +17,9 @@ let appPort ...@@ -17,7 +17,9 @@ let appPort
let app let app
describe('Image Component Trailing Slash Tests', () => { describe('Image Component Trailing Slash Tests', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -43,7 +45,8 @@ describe('Image Component Trailing Slash Tests', () => { ...@@ -43,7 +45,8 @@ describe('Image Component Trailing Slash Tests', () => {
} }
} }
}) })
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -55,8 +55,9 @@ describe('TypeScript Image Component', () => { ...@@ -55,8 +55,9 @@ describe('TypeScript Image Component', () => {
}) })
} }
) )
;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
describe('development mode', () => { 'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
output = '' output = ''
appPort = await findPort() appPort = await findPort()
...@@ -68,7 +69,10 @@ describe('TypeScript Image Component', () => { ...@@ -68,7 +69,10 @@ describe('TypeScript Image Component', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
it('should have image types when enabled', async () => { it('should have image types when enabled', async () => {
const envTypes = await fs.readFile(join(appDir, 'next-env.d.ts'), 'utf8') const envTypes = await fs.readFile(
join(appDir, 'next-env.d.ts'),
'utf8'
)
expect(envTypes).toContain('image-types/global') expect(envTypes).toContain('image-types/global')
}) })
...@@ -82,7 +86,8 @@ describe('TypeScript Image Component', () => { ...@@ -82,7 +86,8 @@ describe('TypeScript Image Component', () => {
await renderViaHTTP(appPort, '/invalid', {}) await renderViaHTTP(appPort, '/invalid', {})
expect(output).toMatch(/Error: Image/) expect(output).toMatch(/Error: Image/)
}) })
}) }
)
describe('development mode 2', () => { describe('development mode 2', () => {
it('should remove global image types when disabled (dev)', async () => { it('should remove global image types when disabled (dev)', async () => {
......
...@@ -68,7 +68,9 @@ function runTests() { ...@@ -68,7 +68,9 @@ function runTests() {
} }
describe('Image Component Unicode Image URL', () => { describe('Image Component Unicode Image URL', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -81,7 +83,8 @@ describe('Image Component Unicode Image URL', () => { ...@@ -81,7 +83,8 @@ describe('Image Component Unicode Image URL', () => {
} }
}) })
runTests() runTests()
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -98,7 +98,9 @@ function runTests() { ...@@ -98,7 +98,9 @@ function runTests() {
} }
describe('Unoptimized Image Tests', () => { describe('Unoptimized Image Tests', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -108,7 +110,8 @@ describe('Unoptimized Image Tests', () => { ...@@ -108,7 +110,8 @@ describe('Unoptimized Image Tests', () => {
}) })
runTests() runTests()
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -1515,7 +1515,9 @@ function runTests(mode) { ...@@ -1515,7 +1515,9 @@ function runTests(mode) {
} }
describe('Image Component Default Tests', () => { describe('Image Component Default Tests', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -1525,7 +1527,8 @@ describe('Image Component Default Tests', () => { ...@@ -1525,7 +1527,8 @@ describe('Image Component Default Tests', () => {
}) })
runTests('dev') runTests('dev')
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -263,8 +263,9 @@ describe('Static Image Component Tests', () => { ...@@ -263,8 +263,9 @@ describe('Static Image Component Tests', () => {
runTests(false) runTests(false)
} }
) )
;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
describe('development mode', () => { 'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -276,5 +277,6 @@ describe('Static Image Component Tests', () => { ...@@ -276,5 +277,6 @@ describe('Static Image Component Tests', () => {
killApp(app) killApp(app)
}) })
runTests(true) runTests(true)
}) }
)
}) })
...@@ -16,7 +16,9 @@ let appPort ...@@ -16,7 +16,9 @@ let appPort
let app let app
describe('Image Component assetPrefix Tests', () => { describe('Image Component assetPrefix Tests', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
let stdout = '' let stdout = ''
let stderr = '' let stderr = ''
beforeAll(async () => { beforeAll(async () => {
...@@ -55,7 +57,8 @@ describe('Image Component assetPrefix Tests', () => { ...@@ -55,7 +57,8 @@ describe('Image Component assetPrefix Tests', () => {
expect(stderr).not.toContain(warningMessage) expect(stderr).not.toContain(warningMessage)
expect(stdout).not.toContain(warningMessage) expect(stdout).not.toContain(warningMessage)
}) })
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
...@@ -84,6 +87,7 @@ describe('Image Component assetPrefix Tests', () => { ...@@ -84,6 +87,7 @@ describe('Image Component assetPrefix Tests', () => {
expect(bgImage).toMatch('data:image/jpeg;base64') expect(bgImage).toMatch('data:image/jpeg;base64')
}) })
// eslint-disable-next-line jest/no-identical-title
it('should not log a deprecation warning about using `images.domains`', async () => { it('should not log a deprecation warning about using `images.domains`', async () => {
await webdriver(appPort, '/') await webdriver(appPort, '/')
const warningMessage = const warningMessage =
......
...@@ -195,7 +195,9 @@ function runTests(mode) { ...@@ -195,7 +195,9 @@ function runTests(mode) {
} }
describe('Image Component basePath Tests', () => { describe('Image Component basePath Tests', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -205,7 +207,8 @@ describe('Image Component basePath Tests', () => { ...@@ -205,7 +207,8 @@ describe('Image Component basePath Tests', () => {
}) })
runTests('dev') runTests('dev')
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -209,8 +209,9 @@ describe('Static Image Component Tests for basePath', () => { ...@@ -209,8 +209,9 @@ describe('Static Image Component Tests for basePath', () => {
runTests(false) runTests(false)
} }
) )
;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
describe('development mode', () => { 'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -222,5 +223,6 @@ describe('Static Image Component Tests for basePath', () => { ...@@ -222,5 +223,6 @@ describe('Static Image Component Tests for basePath', () => {
killApp(app) killApp(app)
}) })
runTests(true) runTests(true)
}) }
)
}) })
...@@ -42,7 +42,9 @@ const runTests = () => { ...@@ -42,7 +42,9 @@ const runTests = () => {
} }
describe('Image Component basePath + trailingSlash Tests', () => { describe('Image Component basePath + trailingSlash Tests', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -50,7 +52,8 @@ describe('Image Component basePath + trailingSlash Tests', () => { ...@@ -50,7 +52,8 @@ describe('Image Component basePath + trailingSlash Tests', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
runTests() runTests()
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -1523,7 +1523,9 @@ function runTests(mode) { ...@@ -1523,7 +1523,9 @@ function runTests(mode) {
} }
describe('Image Component Default Tests', () => { describe('Image Component Default Tests', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -1533,7 +1535,8 @@ describe('Image Component Default Tests', () => { ...@@ -1533,7 +1535,8 @@ describe('Image Component Default Tests', () => {
}) })
runTests('dev') runTests('dev')
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -275,8 +275,9 @@ describe('Static Image Component Tests', () => { ...@@ -275,8 +275,9 @@ describe('Static Image Component Tests', () => {
runTests(false) runTests(false)
} }
) )
;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
describe('development mode', () => { 'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -288,5 +289,6 @@ describe('Static Image Component Tests', () => { ...@@ -288,5 +289,6 @@ describe('Static Image Component Tests', () => {
killApp(app) killApp(app)
}) })
runTests(true) runTests(true)
}) }
)
}) })
...@@ -16,7 +16,9 @@ let app ...@@ -16,7 +16,9 @@ let app
let stderr = '' let stderr = ''
describe('next/image with output export config', () => { describe('next/image with output export config', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort, { app = await launchApp(appDir, appPort, {
...@@ -37,5 +39,6 @@ describe('next/image with output export config', () => { ...@@ -37,5 +39,6 @@ describe('next/image with output export config', () => {
expect(await getRedboxHeader(browser)).toContain(msg) expect(await getRedboxHeader(browser)).toContain(msg)
expect(stderr).toContain(msg) expect(stderr).toContain(msg)
}) })
}) }
)
}) })
...@@ -49,7 +49,9 @@ function runTests({ isDev }) { ...@@ -49,7 +49,9 @@ function runTests({ isDev }) {
} }
describe('Missing Import Image Tests', () => { describe('Missing Import Image Tests', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
stderr = '' stderr = ''
appPort = await findPort() appPort = await findPort()
...@@ -66,7 +68,8 @@ describe('Missing Import Image Tests', () => { ...@@ -66,7 +68,8 @@ describe('Missing Import Image Tests', () => {
}) })
runTests({ isDev: true }) runTests({ isDev: true })
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -43,7 +43,9 @@ function runTests() { ...@@ -43,7 +43,9 @@ function runTests() {
} }
describe('Image Loader Config with Edge Runtime', () => { describe('Image Loader Config with Edge Runtime', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -56,7 +58,8 @@ describe('Image Loader Config with Edge Runtime', () => { ...@@ -56,7 +58,8 @@ describe('Image Loader Config with Edge Runtime', () => {
} }
}) })
runTests() runTests()
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -10,7 +10,9 @@ let app: Awaited<ReturnType<typeof launchApp>> ...@@ -10,7 +10,9 @@ let app: Awaited<ReturnType<typeof launchApp>>
let output = '' let output = ''
describe('Image with middleware in edge func', () => { describe('Image with middleware in edge func', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort, { app = await launchApp(appDir, appPort, {
...@@ -33,7 +35,10 @@ describe('Image with middleware in edge func', () => { ...@@ -33,7 +35,10 @@ describe('Image with middleware in edge func', () => {
*/ */
await webdriver(appPort, '/') await webdriver(appPort, '/')
await check(() => output, /compiled \//i) await check(() => output, /compiled \//i)
expect(output).not.toContain(`'preload' is not exported from 'react-dom'`) expect(output).not.toContain(
}) `'preload' is not exported from 'react-dom'`
)
}) })
}
)
}) })
...@@ -31,8 +31,9 @@ let devOutput ...@@ -31,8 +31,9 @@ let devOutput
}) })
} }
) )
;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
describe('development mode', () => { 'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
devOutput = { stdout: '', stderr: '' } devOutput = { stdout: '', stderr: '' }
appPort = await findPort() appPort = await findPort()
...@@ -54,6 +55,7 @@ let devOutput ...@@ -54,6 +55,7 @@ let devOutput
.filter((line) => line && !line.trim().startsWith('⚠️')) .filter((line) => line && !line.trim().startsWith('⚠️'))
expect(errors).toEqual([]) expect(errors).toEqual([])
}) })
}) }
)
} }
) )
...@@ -17,7 +17,9 @@ let appPort ...@@ -17,7 +17,9 @@ let appPort
let app let app
describe('Image Component Trailing Slash Tests', () => { describe('Image Component Trailing Slash Tests', () => {
describe('development mode', () => { ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
appPort = await findPort() appPort = await findPort()
app = await launchApp(appDir, appPort) app = await launchApp(appDir, appPort)
...@@ -43,7 +45,8 @@ describe('Image Component Trailing Slash Tests', () => { ...@@ -43,7 +45,8 @@ describe('Image Component Trailing Slash Tests', () => {
} }
} }
}) })
}) }
)
;(process.env.TURBOPACK_DEV ? describe.skip : describe)( ;(process.env.TURBOPACK_DEV ? describe.skip : describe)(
'production mode', 'production mode',
() => { () => {
......
...@@ -55,8 +55,9 @@ describe('TypeScript Image Component', () => { ...@@ -55,8 +55,9 @@ describe('TypeScript Image Component', () => {
}) })
} }
) )
;(process.env.TURBOPACK_BUILD ? describe.skip : describe)(
describe('development mode', () => { 'development mode',
() => {
beforeAll(async () => { beforeAll(async () => {
output = '' output = ''
appPort = await findPort() appPort = await findPort()
...@@ -68,7 +69,10 @@ describe('TypeScript Image Component', () => { ...@@ -68,7 +69,10 @@ describe('TypeScript Image Component', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
it('should have image types when enabled', async () => { it('should have image types when enabled', async () => {
const envTypes = await fs.readFile(join(appDir, 'next-env.d.ts'), 'utf8') const envTypes = await fs.readFile(
join(appDir, 'next-env.d.ts'),
'utf8'
)
expect(envTypes).toContain('image-types/global') expect(envTypes).toContain('image-types/global')
}) })
...@@ -82,7 +86,8 @@ describe('TypeScript Image Component', () => { ...@@ -82,7 +86,8 @@ describe('TypeScript Image Component', () => {
await renderViaHTTP(appPort, '/invalid', {}) await renderViaHTTP(appPort, '/invalid', {})
expect(output).toMatch(/Error: Image/) expect(output).toMatch(/Error: Image/)
}) })
}) }
)
it('should remove global image types when disabled (dev)', async () => { it('should remove global image types when disabled (dev)', async () => {
const content = await fs.readFile(nextConfig, 'utf8') const content = await fs.readFile(nextConfig, 'utf8')
......
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