diff --git a/test/integration/broken-webpack-plugin/test/index.test.js b/test/integration/broken-webpack-plugin/test/index.test.js index 2c3d6901619d2..3b69a4741ef0a 100644 --- a/test/integration/broken-webpack-plugin/test/index.test.js +++ b/test/integration/broken-webpack-plugin/test/index.test.js @@ -9,32 +9,36 @@ const appDir = join(__dirname, '../') let appPort let app -describe('Handles a broken webpack plugin (precompile)', () => { - let stderr = '' - beforeAll(async () => { - appPort = await findPort() - app = await launchApp(appDir, appPort, { - stderr: true, - nextStart: true, - onStderr(text) { - stderr += text - }, + // Skipped as it's not relevant to Turbopack. +;(process.env.TURBOPACK ? describe.skip : describe)( + 'Handles a broken webpack plugin (precompile)', + () => { + let stderr = '' + beforeAll(async () => { + appPort = await findPort() + app = await launchApp(appDir, appPort, { + stderr: true, + nextStart: true, + onStderr(text) { + stderr += text + }, + }) + await waitPort({ + host: 'localhost', + port: appPort, + }) }) - await waitPort({ - host: 'localhost', - port: appPort, - }) - }) - afterAll(() => killApp(app)) + afterAll(() => killApp(app)) - beforeEach(() => { - stderr = '' - }) + beforeEach(() => { + stderr = '' + }) - it('should render error correctly', async () => { - const text = await renderViaHTTP(appPort, '/') - expect(text).toContain('Internal Server Error') + it('should render error correctly', async () => { + const text = await renderViaHTTP(appPort, '/') + expect(text).toContain('Internal Server Error') - expect(stderr).toMatch('Error: oops') - }) -}) + expect(stderr).toMatch('Error: oops') + }) + } +) diff --git a/test/integration/chunking/test/index.test.js b/test/integration/chunking/test/index.test.js index c6e1ca39ad5ef..e7e8aee57a79b 100644 --- a/test/integration/chunking/test/index.test.js +++ b/test/integration/chunking/test/index.test.js @@ -22,7 +22,8 @@ const existsChunkNamed = (name) => { return chunks.some((chunk) => new RegExp(name).test(chunk)) } -describe('Chunking', () => { +// Skipped as it uses webpack internals / stats.json. +;(process.env.TURBOPACK ? describe.skip : describe)('Chunking', () => { ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { beforeAll(async () => { try { diff --git a/test/integration/config-devtool-dev/test/index.test.js b/test/integration/config-devtool-dev/test/index.test.js index 510917865d2f1..f6154d9464ac1 100644 --- a/test/integration/config-devtool-dev/test/index.test.js +++ b/test/integration/config-devtool-dev/test/index.test.js @@ -13,30 +13,33 @@ import { join } from 'path' const appDir = join(__dirname, '../') -describe('devtool set in development mode in next config', () => { - it('should warn and revert when a devtool is set in development mode', async () => { - let stderr = '' - - const appPort = await findPort() - const app = await launchApp(appDir, appPort, { - env: { __NEXT_TEST_WITH_DEVTOOL: true }, - onStderr(msg) { - stderr += msg || '' - }, - }) - - const found = await check( - () => stderr, - /Reverting webpack devtool to /, - false - ) - - const browser = await webdriver(appPort, '/') - expect(await hasRedbox(browser, true)).toBe(true) - if (process.platform === 'win32') { - // TODO: add win32 snapshot - } else { - expect(await getRedboxSource(browser)).toMatchInlineSnapshot(` +// Webpack specific config tests. +;(process.env.TURBOPACK ? describe.skip : describe)( + 'devtool set in development mode in next config', + () => { + it('should warn and revert when a devtool is set in development mode', async () => { + let stderr = '' + + const appPort = await findPort() + const app = await launchApp(appDir, appPort, { + env: { __NEXT_TEST_WITH_DEVTOOL: true }, + onStderr(msg) { + stderr += msg || '' + }, + }) + + const found = await check( + () => stderr, + /Reverting webpack devtool to /, + false + ) + + const browser = await webdriver(appPort, '/') + expect(await hasRedbox(browser, true)).toBe(true) + if (process.platform === 'win32') { + // TODO: add win32 snapshot + } else { + expect(await getRedboxSource(browser)).toMatchInlineSnapshot(` "pages/index.js (5:10) @ eval 3 | export default function Index(props) { @@ -47,10 +50,11 @@ describe('devtool set in development mode in next config', () => { 7 | return
Index Page
8 | }" `) - } - await browser.close() + } + await browser.close() - await killApp(app) - expect(found).toBeTruthy() - }) -}) + await killApp(app) + expect(found).toBeTruthy() + }) + } +) diff --git a/test/integration/next-image-legacy/svgo-webpack/test/index.test.ts b/test/integration/next-image-legacy/svgo-webpack/test/index.test.ts index a60e49c23319c..ef8b01c012ae2 100644 --- a/test/integration/next-image-legacy/svgo-webpack/test/index.test.ts +++ b/test/integration/next-image-legacy/svgo-webpack/test/index.test.ts @@ -14,33 +14,40 @@ let appPort let app let devOutput -describe('svgo-webpack with Image Component', () => { - ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { - it('should not fail to build invalid usage of the Image component', async () => { - const { stderr, code } = await nextBuild(appDir, [], { stderr: true }) - expect(stderr).toBeFalsy() - expect(code).toBe(0) - }) - }) + // Skip as this is a webpack specific test. +;(process.env.TURBOPACK ? describe.skip : describe)( + 'svgo-webpack with Image Component', + () => { + ;(process.env.TURBOPACK ? describe.skip : describe)( + 'production mode', + () => { + it('should not fail to build invalid usage of the Image component', async () => { + const { stderr, code } = await nextBuild(appDir, [], { stderr: true }) + expect(stderr).toBeFalsy() + expect(code).toBe(0) + }) + } + ) - describe('development mode', () => { - beforeAll(async () => { - devOutput = { stdout: '', stderr: '' } - appPort = await findPort() - app = await launchApp(appDir, appPort, { - onStdout: (msg) => { - devOutput.stdout += msg - }, - onStderr: (msg) => { - devOutput.stderr += msg - }, + describe('development mode', () => { + beforeAll(async () => { + devOutput = { stdout: '', stderr: '' } + appPort = await findPort() + app = await launchApp(appDir, appPort, { + onStdout: (msg) => { + devOutput.stdout += msg + }, + onStderr: (msg) => { + devOutput.stderr += msg + }, + }) }) - }) - afterAll(() => killApp(app)) + afterAll(() => killApp(app)) - it('should print error when invalid Image usage', async () => { - await renderViaHTTP(appPort, '/', {}) - expect(devOutput.stderr).toBeFalsy() + it('should print error when invalid Image usage', async () => { + await renderViaHTTP(appPort, '/', {}) + expect(devOutput.stderr).toBeFalsy() + }) }) - }) -}) + } +) diff --git a/test/integration/next-image-new/svgo-webpack/test/index.test.ts b/test/integration/next-image-new/svgo-webpack/test/index.test.ts index 825782d59febf..6962b82650ba3 100644 --- a/test/integration/next-image-new/svgo-webpack/test/index.test.ts +++ b/test/integration/next-image-new/svgo-webpack/test/index.test.ts @@ -14,39 +14,46 @@ let appPort let app let devOutput -describe('svgo-webpack with Image Component', () => { - ;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => { - it('should not fail to build invalid usage of the Image component', async () => { - const { stderr, code } = await nextBuild(appDir, [], { stderr: true }) - const errors = stderr - .split('\n') - .filter((line) => line && !line.trim().startsWith('⚠️')) - expect(errors).toEqual([]) - expect(code).toBe(0) - }) - }) + // Skip as this is a webpack specific test. +;(process.env.TURBOPACK ? describe.skip : describe)( + 'svgo-webpack with Image Component', + () => { + ;(process.env.TURBOPACK ? describe.skip : describe)( + 'production mode', + () => { + it('should not fail to build invalid usage of the Image component', async () => { + const { stderr, code } = await nextBuild(appDir, [], { stderr: true }) + const errors = stderr + .split('\n') + .filter((line) => line && !line.trim().startsWith('⚠️')) + expect(errors).toEqual([]) + expect(code).toBe(0) + }) + } + ) - describe('development mode', () => { - beforeAll(async () => { - devOutput = { stdout: '', stderr: '' } - appPort = await findPort() - app = await launchApp(appDir, appPort, { - onStdout: (msg) => { - devOutput.stdout += msg - }, - onStderr: (msg) => { - devOutput.stderr += msg - }, + describe('development mode', () => { + beforeAll(async () => { + devOutput = { stdout: '', stderr: '' } + appPort = await findPort() + app = await launchApp(appDir, appPort, { + onStdout: (msg) => { + devOutput.stdout += msg + }, + onStderr: (msg) => { + devOutput.stderr += msg + }, + }) }) - }) - afterAll(() => killApp(app)) + afterAll(() => killApp(app)) - it('should print error when invalid Image usage', async () => { - await renderViaHTTP(appPort, '/', {}) - const errors = devOutput.stderr - .split('\n') - .filter((line) => line && !line.trim().startsWith('⚠️')) - expect(errors).toEqual([]) + it('should print error when invalid Image usage', async () => { + await renderViaHTTP(appPort, '/', {}) + const errors = devOutput.stderr + .split('\n') + .filter((line) => line && !line.trim().startsWith('⚠️')) + expect(errors).toEqual([]) + }) }) - }) -}) + } +)