Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wolmir committed Oct 3, 2022
1 parent 3f9ded2 commit d962189
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 20 deletions.
17 changes: 0 additions & 17 deletions languageServer/src/documentSelector.ts

This file was deleted.

7 changes: 5 additions & 2 deletions languageServer/src/test/definitions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,20 +104,23 @@ describe('textDocument/definitions', () => {
languageId: 'json',
mockContents: '',
mockPath: 'moreParams/otherParams.json'
},
{
languageId: 'blankLang',
mockContents: '',
mockPath: 'data/blankFile'
}
])

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'
Expand Down
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 @@ -77,6 +77,7 @@ stages:
params:
- params.json
- moreParams/otherParams.json
- data/blankFile
stage2:
cmd:
- echo hello
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const openTheseFilesAndNotifyServer = async (
const textDocument = TextDocument.create(uri, languageId, 1, mockContents)
await client.sendNotification(DidOpenTextDocumentNotification.type, {
textDocument: {
languageId: 'yaml',
languageId,
text: textDocument.getText(),
uri: textDocument.uri,
version: textDocument.version
Expand Down

0 comments on commit d962189

Please sign in to comment.