diff --git a/packages/tailwindcss-language-server/tests/code-actions/code-actions.v2.test.js b/packages/tailwindcss-language-server/tests/code-actions/code-actions.v2.test.js index d16d0c407b4e5adae322d314a62a8b25a8f3c920..8cd25a7af7280908cdb2d15e1c93db3c2d43a30e 100644 --- a/packages/tailwindcss-language-server/tests/code-actions/code-actions.v2.test.js +++ b/packages/tailwindcss-language-server/tests/code-actions/code-actions.v2.test.js @@ -4,43 +4,50 @@ import * as fs from 'node:fs/promises' withFixture('v2', (c) => { function testFixture(fixture) { + test( + fixture, + async () => { + fixture = await fs.readFile(`tests/code-actions/${fixture}.json`, 'utf8') + + let { code, expected, language = 'html' } = JSON.parse(fixture) + +import * as fs from 'node:fs/promises' test(fixture, async () => { +import * as fs from 'node:fs/promises' fixture = await fs.readFile(`tests/code-actions/${fixture}.json`, 'utf8') - +import * as fs from 'node:fs/promises' let { code, expected, language = 'html' } = JSON.parse(fixture) -import { test, expect } from 'vitest' import { test, expect } from 'vitest' -import { test, expect } from 'vitest' +import * as fs from 'node:fs/promises' + + import { test, expect } from 'vitest' + import { withFixture } from '../common' -import { test, expect } from 'vitest' + + import * as fs from 'node:fs/promises' -import { test, expect } from 'vitest' + -import { test, expect } from 'vitest' withFixture('v2', (c) => { -import { test, expect } from 'vitest' + function testFixture(fixture) { -import { test, expect } from 'vitest' test(fixture, async () => { import { test, expect } from 'vitest' - fixture = await fs.readFile(`tests/code-actions/${fixture}.json`, 'utf8') +import * as fs from 'node:fs/promises' - context: { - diagnostics, - }, + // console.log(JSON.stringify(res)) -import { test, expect } from 'vitest' - // console.log(JSON.stringify(res)) + expected = JSON.parse(JSON.stringify(expected).replaceAll('{{URI}}', textDocument.uri)) - expected = JSON.parse(JSON.stringify(expected).replaceAll('{{URI}}', textDocument.uri)) + expect(res).toEqual(expected) - + }, +withFixture('v2', (c) => { import { withFixture } from '../common' - -import { withFixture } from '../common' withFixture('v2', (c) => { +import * as fs from 'node:fs/promises' } // testFixture('conflict') diff --git a/packages/tailwindcss-language-server/vitest.config.ts b/packages/tailwindcss-language-server/vitest.config.ts deleted file mode 100644 index a079f2e6c8b10071983a50ed3482e92ecfe7598a..0000000000000000000000000000000000000000 --- a/packages/tailwindcss-language-server/vitest.config.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { defineConfig } from 'vitest/config' - -export default defineConfig({ - test: { - testTimeout: 15000, - }, -})