From 42b004efc223753f98130e9374af53420a64334d Mon Sep 17 00:00:00 2001 From: OJ Kwon <1210596+kwonoj@users.noreply.github.com> Date: Fri, 8 Sep 2023 12:26:07 -0700 Subject: [PATCH] refactor(test): use testsetup fixtures --- test/development/basic/tailwind-jit.test.ts | 36 +++++++++------------ 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/test/development/basic/tailwind-jit.test.ts b/test/development/basic/tailwind-jit.test.ts index 8b8c0bbd5d02d..533cd10ebc94d 100644 --- a/test/development/basic/tailwind-jit.test.ts +++ b/test/development/basic/tailwind-jit.test.ts @@ -1,7 +1,6 @@ import { join } from 'path' import webdriver from 'next-webdriver' -import { createNext, FileRef } from 'e2e-utils' -import { NextInstance } from 'test/lib/next-modes/base' +import { FileRef, nextTestSetup } from 'e2e-utils' import { check, shouldRunTurboDevTest } from 'next-test-utils' // [TODO]: It is unclear why turbopack takes longer to run this test @@ -11,26 +10,21 @@ if (shouldRunTurboDevTest()) { } describe('TailwindCSS JIT', () => { - let next: NextInstance - - beforeAll(async () => { - next = await createNext({ - files: { - 'postcss.config.js': new FileRef( - join(__dirname, 'tailwind-jit/postcss.config.js') - ), - 'tailwind.config.js': new FileRef( - join(__dirname, 'tailwind-jit/tailwind.config.js') - ), - pages: new FileRef(join(__dirname, 'tailwind-jit/pages')), - }, - dependencies: { - tailwindcss: '2.2.19', - postcss: '8.3.5', - }, - }) + const { next } = nextTestSetup({ + files: { + 'postcss.config.js': new FileRef( + join(__dirname, 'tailwind-jit/postcss.config.js') + ), + 'tailwind.config.js': new FileRef( + join(__dirname, 'tailwind-jit/tailwind.config.js') + ), + pages: new FileRef(join(__dirname, 'tailwind-jit/pages')), + }, + dependencies: { + tailwindcss: '2.2.19', + postcss: '8.3.5', + }, }) - afterAll(() => next.destroy()) it('works with JIT enabled', async () => { let browser