From b7c7bf5aed3d8fa0a2e9f3bb769ddb7b76ec401a Mon Sep 17 00:00:00 2001 From: OJ Kwon <1210596+kwonoj@users.noreply.github.com> Date: Fri, 8 Sep 2023 09:33:14 -0700 Subject: [PATCH] test(tailwind): remove new fixture, make existing test passes --- test/development/basic/tailwind-jit.test.ts | 8 +++- test/e2e/basic-tailwind/index.test.ts | 46 --------------------- test/e2e/basic-tailwind/pages/_app.js | 5 --- test/e2e/basic-tailwind/pages/index.js | 16 ------- test/e2e/basic-tailwind/postcss.config.js | 6 --- test/e2e/basic-tailwind/styles/global.css | 3 -- test/e2e/basic-tailwind/tailwind.config.js | 12 ------ test/turbopack-tests-manifest.js | 7 ++++ 8 files changed, 14 insertions(+), 89 deletions(-) delete mode 100644 test/e2e/basic-tailwind/index.test.ts delete mode 100644 test/e2e/basic-tailwind/pages/_app.js delete mode 100644 test/e2e/basic-tailwind/pages/index.js delete mode 100644 test/e2e/basic-tailwind/postcss.config.js delete mode 100644 test/e2e/basic-tailwind/styles/global.css delete mode 100644 test/e2e/basic-tailwind/tailwind.config.js diff --git a/test/development/basic/tailwind-jit.test.ts b/test/development/basic/tailwind-jit.test.ts index 1852ba9d736285..8b8c0bbd5d02d8 100644 --- a/test/development/basic/tailwind-jit.test.ts +++ b/test/development/basic/tailwind-jit.test.ts @@ -2,7 +2,13 @@ import { join } from 'path' import webdriver from 'next-webdriver' import { createNext, FileRef } from 'e2e-utils' import { NextInstance } from 'test/lib/next-modes/base' -import { check } from 'next-test-utils' +import { check, shouldRunTurboDevTest } from 'next-test-utils' + +// [TODO]: It is unclear why turbopack takes longer to run this test +// remove once it's fixed +if (shouldRunTurboDevTest()) { + jest.setTimeout(1000 * 60 * 5) +} describe('TailwindCSS JIT', () => { let next: NextInstance diff --git a/test/e2e/basic-tailwind/index.test.ts b/test/e2e/basic-tailwind/index.test.ts deleted file mode 100644 index 4a7b3a6c04afc2..00000000000000 --- a/test/e2e/basic-tailwind/index.test.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* eslint-env jest */ -import { createNext, FileRef } from 'e2e-utils' -import webdriver from 'next-webdriver' -import { join } from 'path' -import type { NextInstance } from 'test/lib/next-modes/base' - -//[NOTE]: This test is migrated from next-dev integration tests for turbopack, -//Extracted into a single test file so we can put this in blocking tests for turbopack (turbopack-tests-manifests.js) -describe('Render css with tailwind', () => { - let next: NextInstance - beforeAll(async () => { - next = await createNext({ - files: { - pages: new FileRef(join(__dirname, 'pages')), - styles: new FileRef(join(__dirname, 'styles')), - 'postcss.config.js': new FileRef(join(__dirname, 'postcss.config.js')), - 'tailwind.config.js': new FileRef( - join(__dirname, 'tailwind.config.js') - ), - }, - dependencies: { - postcss: '^8.4.29', - tailwindcss: '^3.3.3', - autoprefixer: '^10.4.13', - }, - }) - }) - - afterAll(() => next?.destroy()) - - it('should apply global styles', async () => { - let browser - try { - browser = await webdriver(next.url, '/') - - const alignItems = await browser.eval( - `window.getComputedStyle(document.querySelector('footer')).alignItems` - ) - expect(alignItems).toMatchInlineSnapshot(`"center"`) - } finally { - if (browser) { - await browser.close() - } - } - }) -}) diff --git a/test/e2e/basic-tailwind/pages/_app.js b/test/e2e/basic-tailwind/pages/_app.js deleted file mode 100644 index 0bd950249faeb7..00000000000000 --- a/test/e2e/basic-tailwind/pages/_app.js +++ /dev/null @@ -1,5 +0,0 @@ -import '../styles/global.css' - -export default function MyApp({ Component, pageProps }) { - return -} diff --git a/test/e2e/basic-tailwind/pages/index.js b/test/e2e/basic-tailwind/pages/index.js deleted file mode 100644 index 5311664264b65f..00000000000000 --- a/test/e2e/basic-tailwind/pages/index.js +++ /dev/null @@ -1,16 +0,0 @@ -export default function Home() { - return ( -
- -
- ) -} diff --git a/test/e2e/basic-tailwind/postcss.config.js b/test/e2e/basic-tailwind/postcss.config.js deleted file mode 100644 index 33ad091d26d8a9..00000000000000 --- a/test/e2e/basic-tailwind/postcss.config.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - plugins: { - tailwindcss: {}, - autoprefixer: {}, - }, -} diff --git a/test/e2e/basic-tailwind/styles/global.css b/test/e2e/basic-tailwind/styles/global.css deleted file mode 100644 index b5c61c956711f9..00000000000000 --- a/test/e2e/basic-tailwind/styles/global.css +++ /dev/null @@ -1,3 +0,0 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; diff --git a/test/e2e/basic-tailwind/tailwind.config.js b/test/e2e/basic-tailwind/tailwind.config.js deleted file mode 100644 index 95b7c46ff8ab99..00000000000000 --- a/test/e2e/basic-tailwind/tailwind.config.js +++ /dev/null @@ -1,12 +0,0 @@ -/** @type {import('tailwindcss').Config} */ -module.exports = { - content: [ - './pages/**/*.{js,ts,jsx,tsx}', - './components/**/*.{js,ts,jsx,tsx}', - './app/**/*.{js,ts,jsx,tsx}', - ], - theme: { - extend: {}, - }, - plugins: [], -} diff --git a/test/turbopack-tests-manifest.js b/test/turbopack-tests-manifest.js index 19a43fb62de760..79c447ec1a5561 100644 --- a/test/turbopack-tests-manifest.js +++ b/test/turbopack-tests-manifest.js @@ -109,6 +109,7 @@ const enabledTests = [ 'test/e2e/typescript-version-no-warning/typescript-version-no-warning.test.ts', 'test/e2e/typescript-version-warning/typescript-version-warning.test.ts', 'test/e2e/undici-fetch/index.test.ts', +<<<<<<< HEAD 'test/integration/create-next-app/templates-app.test.ts', 'test/integration/create-next-app/templates-pages.test.ts', 'test/integration/custom-routes-i18n-index-redirect/test/index.test.js', @@ -137,6 +138,12 @@ const enabledTests = [ 'test/production/jest/transpile-packages.test.ts', 'test/production/postcss-plugin-config-as-string/index.test.ts', 'test/production/suppo.ts', +======= + 'test/integration/bigint/test/index.test.js', + 'test/e2e/styled-jsx/index.test.ts', + // TODO: re-enable once the logging is aligned + // 'test/integration/middleware-basic/test/index.test.js', +>>>>>>> 9fa53f7891 (test(tailwind): remove new fixture, make existing test passes) ] module.exports = { enabledTests }