From 0ed4e6042145bd0643688f166c01470325ff1c54 Mon Sep 17 00:00:00 2001 From: Le Vivilet <72156503+levivilet@users.noreply.github.com> Date: Sun, 9 Feb 2025 18:41:11 +0100 Subject: [PATCH] feature: add property completion test (#76) --- .../test/property-name-completion.test.ts | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 packages/integration/test/property-name-completion.test.ts diff --git a/packages/integration/test/property-name-completion.test.ts b/packages/integration/test/property-name-completion.test.ts new file mode 100644 index 0000000..03d2e56 --- /dev/null +++ b/packages/integration/test/property-name-completion.test.ts @@ -0,0 +1,34 @@ +import { testWorker } from '../src/testWorker.ts' +import { test, expect } from '@jest/globals' + +test.skip('property-name-completion', async () => { + const execMap = { + 'Json.loadSchema'() { + return { + type: 'object', + properties: { + type: { + type: 'string', + enum: ['commonjs', 'module'], + }, + }, + } + }, + } + const worker = await testWorker({ + execMap, + }) + const offset = 3 + const textDocument = { + uri: 'test://test.json', + text: `{ "" }`, + } + expect( + await worker.execute('Completion.getCompletion', textDocument, offset), + ).toEqual([ + { + kind: 2, + label: 'type', + }, + ]) +})