diff --git a/packages/oxlint-tailwindcss/tests/e2e/cache-dir.test.ts b/packages/oxlint-tailwindcss/tests/e2e/cache-dir.test.ts index 20c4c7f..623fa09 100644 --- a/packages/oxlint-tailwindcss/tests/e2e/cache-dir.test.ts +++ b/packages/oxlint-tailwindcss/tests/e2e/cache-dir.test.ts @@ -167,6 +167,8 @@ describe('E2E: editing a local @plugin invalidates the cached design system', () if (PLUGIN_DIR) rmSync(PLUGIN_DIR, { recursive: true, force: true }) }) + // Two cold precomputes, each allowed the 120 s `run` gives oxlint: vitest's + // default 60 s for the whole test ran out inside a loaded full suite. it('reports the class the edited plugin no longer defines', () => { const cache = join(PLUGIN_DIR, '.cache') expect(diagnostics(run(cache))).toEqual([]) @@ -174,5 +176,5 @@ describe('E2E: editing a local @plugin invalidates the cached design system', () expect(diagnostics(run(cache))).toEqual([ 'tailwindcss(no-unknown-classes) "foo-bar" is not a valid Tailwind class. Did you mean "foo-baz"?', ]) - }) + }, 240_000) }) diff --git a/packages/oxlint-tailwindcss/tests/e2e/logical-shorthand-convergence.test.ts b/packages/oxlint-tailwindcss/tests/e2e/logical-shorthand-convergence.test.ts index cbf537b..1418035 100644 --- a/packages/oxlint-tailwindcss/tests/e2e/logical-shorthand-convergence.test.ts +++ b/packages/oxlint-tailwindcss/tests/e2e/logical-shorthand-convergence.test.ts @@ -66,6 +66,11 @@ function fixInOrder(classes: string, ...stages: Rules[]): string { const SHORTHAND: Rules = { 'tailwindcss/enforce-shorthand': 'warn' } +// An allOrders() is 15 `oxlint --fix` runs in a row, and a test makes up to +// three: about 5 s alone, but well past vitest's default 60 s inside a loaded +// full suite, where each run can take seconds. +const RUNS_TIMEOUT = 180_000 + /** Every order the two fixes can land in: together, either one first. */ function allOrders(classes: string, directional: Rules): string[] { const both = { ...directional, ...SHORTHAND } @@ -77,29 +82,41 @@ function allOrders(classes: string, directional: Rules): string[] { } describe('E2E: directional rules and enforce-shorthand converge', () => { - it('enforce-logical: a block-axis pair ends as the shorthand', () => { - const logical = { 'tailwindcss/enforce-logical': 'warn' } - expect(allOrders('mt-2 mb-2', logical)).toEqual(['my-2', 'my-2', 'my-2']) - expect(allOrders('top-0 bottom-0', logical)).toEqual(['inset-y-0', 'inset-y-0', 'inset-y-0']) - expect(allOrders('left-0 right-0', logical)).toEqual(['inset-x-0', 'inset-x-0', 'inset-x-0']) - }) + it( + 'enforce-logical: a block-axis pair ends as the shorthand', + () => { + const logical = { 'tailwindcss/enforce-logical': 'warn' } + expect(allOrders('mt-2 mb-2', logical)).toEqual(['my-2', 'my-2', 'my-2']) + expect(allOrders('top-0 bottom-0', logical)).toEqual(['inset-y-0', 'inset-y-0', 'inset-y-0']) + expect(allOrders('left-0 right-0', logical)).toEqual(['inset-x-0', 'inset-x-0', 'inset-x-0']) + }, + RUNS_TIMEOUT, + ) - it('enforce-logical with sizing: a width and a height end as the logical pair', () => { - const sizing = { 'tailwindcss/enforce-logical': ['warn', { sizing: true }] } - expect(allOrders('w-4 h-4', sizing)).toEqual([ - 'inline-4 block-4', - 'inline-4 block-4', - 'inline-4 block-4', - ]) - }) + it( + 'enforce-logical with sizing: a width and a height end as the logical pair', + () => { + const sizing = { 'tailwindcss/enforce-logical': ['warn', { sizing: true }] } + expect(allOrders('w-4 h-4', sizing)).toEqual([ + 'inline-4 block-4', + 'inline-4 block-4', + 'inline-4 block-4', + ]) + }, + RUNS_TIMEOUT, + ) - it('enforce-physical: a logical block pair ends as the shorthand', () => { - const physical = { 'tailwindcss/enforce-physical': 'warn' } - expect(allOrders('mbs-2 mbe-2', physical)).toEqual(['my-2', 'my-2', 'my-2']) - expect(allOrders('inset-s-0 inset-e-0', physical)).toEqual([ - 'inset-x-0', - 'inset-x-0', - 'inset-x-0', - ]) - }) + it( + 'enforce-physical: a logical block pair ends as the shorthand', + () => { + const physical = { 'tailwindcss/enforce-physical': 'warn' } + expect(allOrders('mbs-2 mbe-2', physical)).toEqual(['my-2', 'my-2', 'my-2']) + expect(allOrders('inset-s-0 inset-e-0', physical)).toEqual([ + 'inset-x-0', + 'inset-x-0', + 'inset-x-0', + ]) + }, + RUNS_TIMEOUT, + ) })