Skip to content

Commit 2e17570

Browse files
committed
Test onDidChangeConfiguration
1 parent 9a3845e commit 2e17570

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

server/src/__tests__/server.test.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,25 @@ describe('server', () => {
146146
])
147147
})
148148

149+
it('responds to onDidChangeConfiguration', async () => {
150+
const { connection } = await initializeServer({
151+
capabilities: {
152+
workspace: {
153+
configuration: true,
154+
},
155+
},
156+
})
157+
158+
const onDidChangeConfiguration = connection.onDidChangeConfiguration.mock.calls[0][0]
159+
160+
onDidChangeConfiguration({ settings: { bashIde: { explainshellEndpoint: 42 } } })
161+
162+
expect(connection.workspace.getConfiguration).toHaveBeenCalled()
163+
expect(Logger.prototype.log).toHaveBeenCalledWith(expect.any(Number), [
164+
expect.stringContaining('updateConfiguration: failed'),
165+
])
166+
})
167+
149168
describe('onCodeAction', () => {
150169
it('responds to onCodeAction', async () => {
151170
const { connection, server } = await initializeServer()

0 commit comments

Comments
 (0)