Skip to content

Commit

Permalink
Test onDidChangeConfiguration
Browse files Browse the repository at this point in the history
  • Loading branch information
skovhus committed Jan 23, 2023
1 parent 9a3845e commit 2e17570
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions server/src/__tests__/server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,25 @@ describe('server', () => {
])
})

it('responds to onDidChangeConfiguration', async () => {
const { connection } = await initializeServer({
capabilities: {
workspace: {
configuration: true,
},
},
})

const onDidChangeConfiguration = connection.onDidChangeConfiguration.mock.calls[0][0]

onDidChangeConfiguration({ settings: { bashIde: { explainshellEndpoint: 42 } } })

expect(connection.workspace.getConfiguration).toHaveBeenCalled()
expect(Logger.prototype.log).toHaveBeenCalledWith(expect.any(Number), [
expect.stringContaining('updateConfiguration: failed'),
])
})

describe('onCodeAction', () => {
it('responds to onCodeAction', async () => {
const { connection, server } = await initializeServer()
Expand Down

0 comments on commit 2e17570

Please sign in to comment.