Skip to content

Commit

Permalink
Add a test for composite file paths
Browse files Browse the repository at this point in the history
  • Loading branch information
wolmir committed Oct 3, 2022
1 parent e9f395c commit 3f9ded2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
16 changes: 15 additions & 1 deletion languageServer/src/test/definitions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
})
})
})
1 change: 1 addition & 0 deletions languageServer/src/test/fixtures/examples/valid/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ stages:
cmd: echo foo
params:
- params.json
- moreParams/otherParams.json
stage2:
cmd:
- echo hello
Expand Down

0 comments on commit 3f9ded2

Please sign in to comment.