From 3f9ded2468e39da8b573c9b64e5a7e0ef61c1ebe Mon Sep 17 00:00:00 2001 From: Wolmir Nemitz Date: Mon, 3 Oct 2022 13:27:17 -0300 Subject: [PATCH] Add a test for composite file paths --- languageServer/src/test/definitions.test.ts | 16 +++++++++++++++- .../src/test/fixtures/examples/valid/index.ts | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/languageServer/src/test/definitions.test.ts b/languageServer/src/test/definitions.test.ts index bdb75d52d8..2187bf49f4 100644 --- a/languageServer/src/test/definitions.test.ts +++ b/languageServer/src/test/definitions.test.ts @@ -99,14 +99,28 @@ describe('textDocument/definitions', () => { languageId: 'json', mockContents: '', mockPath: 'params.json' + }, + { + languageId: 'json', + mockContents: '', + mockPath: 'moreParams/otherParams.json' } ]) - const response = await requestDefinitions(dvcYaml, 'params.json') + + let response = await requestDefinitions(dvcYaml, 'params.json') expect(response).toBeTruthy() expect(response).toStrictEqual({ range: Range.create(Position.create(0, 0), Position.create(0, 0)), uri: 'file:///params.json' }) + + response = await requestDefinitions(dvcYaml, 'otherParams.json') + + expect(response).toBeTruthy() + expect(response).toStrictEqual({ + range: Range.create(Position.create(0, 0), Position.create(0, 0)), + uri: 'file:///moreParams/otherParams.json' + }) }) }) diff --git a/languageServer/src/test/fixtures/examples/valid/index.ts b/languageServer/src/test/fixtures/examples/valid/index.ts index f77f34c543..1bf7066e3d 100644 --- a/languageServer/src/test/fixtures/examples/valid/index.ts +++ b/languageServer/src/test/fixtures/examples/valid/index.ts @@ -76,6 +76,7 @@ stages: cmd: echo foo params: - params.json + - moreParams/otherParams.json stage2: cmd: - echo hello