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 8cd25a7..d16d0c4 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,36 +4,32 @@ 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') + test(fixture, async () => { + fixture = await fs.readFile(`tests/code-actions/${fixture}.json`, 'utf8') - let { code, expected, language = 'html' } = JSON.parse(fixture) + let { code, expected, language = 'html' } = JSON.parse(fixture) - let promise = new Promise((resolve) => { - c.onNotification('textDocument/publishDiagnostics', ({ diagnostics }) => { - resolve(diagnostics) - }) + let promise = new Promise((resolve) => { + c.onNotification('textDocument/publishDiagnostics', ({ diagnostics }) => { + resolve(diagnostics) }) + }) - let textDocument = await c.openDocument({ text: code, lang: language }) - let diagnostics = await promise + let textDocument = await c.openDocument({ text: code, lang: language }) + let diagnostics = await promise - let res = await c.sendRequest('textDocument/codeAction', { - textDocument, - context: { - diagnostics, - }, - }) - // console.log(JSON.stringify(res)) + let res = await c.sendRequest('textDocument/codeAction', { + textDocument, + context: { + diagnostics, + }, + }) + // 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) - }, - 10000 - ) + expect(res).toEqual(expected) + }) } // testFixture('conflict') diff --git a/packages/tailwindcss-language-server/vitest.config.ts b/packages/tailwindcss-language-server/vitest.config.ts new file mode 100644 index 0000000..a079f2e --- /dev/null +++ b/packages/tailwindcss-language-server/vitest.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'vitest/config' + +export default defineConfig({ + test: { + testTimeout: 15000, + }, +})