From 497f9e83cb8032a688784b529dc4b095f85ba300 Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Tue, 10 Sep 2024 18:23:01 +0200 Subject: [PATCH] Turbopack build: Skip webpack specific test (#69923) These two are testing webpack config. --- .../build-warnings/test/index.test.js | 52 +++++++++++-------- test/turbopack-build-tests-manifest.json | 4 +- 2 files changed, 33 insertions(+), 23 deletions(-) diff --git a/test/integration/build-warnings/test/index.test.js b/test/integration/build-warnings/test/index.test.js index c3a54966833b1..fe3f54f960af6 100644 --- a/test/integration/build-warnings/test/index.test.js +++ b/test/integration/build-warnings/test/index.test.js @@ -14,37 +14,47 @@ describe('Build warnings', () => { const { stderr } = await nextBuild(appDir, undefined, { stderr: true }) expect(stderr).not.toContain('optimization has been disabled') }) + ;(process.env.TURBOPACK ? it.skip : it)( + 'should shown warning about minification for minimize', + async () => { + const nextConfig = new File(join(appDir, 'next.config.js')) - it('should shown warning about minification for minimize', async () => { - const nextConfig = new File(join(appDir, 'next.config.js')) + await waitFor(500) - await waitFor(500) + nextConfig.replace('true', 'false') - nextConfig.replace('true', 'false') + const { stderr } = await nextBuild(appDir, undefined, { + stderr: true, + }) - const { stderr } = await nextBuild(appDir, undefined, { stderr: true }) - - expect(stderr).toContain('optimization has been disabled') - - nextConfig.restore() - }) + // eslint-disable-next-line jest/no-standalone-expect + expect(stderr).toContain('optimization has been disabled') - it('should shown warning about minification for minimizer', async () => { - const nextConfig = new File(join(appDir, 'next.config.js')) + nextConfig.restore() + } + ) + ;(process.env.TURBOPACK ? it.skip : it)( + 'should shown warning about minification for minimizer', + async () => { + const nextConfig = new File(join(appDir, 'next.config.js')) - await waitFor(500) + await waitFor(500) - nextConfig.replace( - 'config.optimization.minimize = true', - 'config.optimization.minimizer = []' - ) + nextConfig.replace( + 'config.optimization.minimize = true', + 'config.optimization.minimizer = []' + ) - const { stderr } = await nextBuild(appDir, undefined, { stderr: true }) + const { stderr } = await nextBuild(appDir, undefined, { + stderr: true, + }) - expect(stderr).toContain('optimization has been disabled') + // eslint-disable-next-line jest/no-standalone-expect + expect(stderr).toContain('optimization has been disabled') - nextConfig.restore() - }) + nextConfig.restore() + } + ) it('should not warn about missing cache in non-CI', async () => { await remove(join(appDir, '.next')) diff --git a/test/turbopack-build-tests-manifest.json b/test/turbopack-build-tests-manifest.json index a5263d1653df7..d2016985cef9f 100644 --- a/test/turbopack-build-tests-manifest.json +++ b/test/turbopack-build-tests-manifest.json @@ -7326,11 +7326,11 @@ "Build warnings production mode should not warn about missing cache on supported platforms", "Build warnings production mode should warn about missing cache in CI" ], - "failed": [ + "failed": [], + "pending": [ "Build warnings production mode should shown warning about minification for minimize", "Build warnings production mode should shown warning about minification for minimizer" ], - "pending": [], "flakey": [], "runtimeError": false },