Skip to content

Commit c1a8c59

Browse files
committed
update
1 parent 7669044 commit c1a8c59

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

packages/amazonq/test/e2e/lsp/lspInstaller.test.ts

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import assert from 'assert'
77
import sinon from 'sinon'
88
import { AmazonQLSPResolver } from '../../../src/lsp/lspInstaller'
99
import {
10+
DevSettings,
1011
fs,
1112
globals,
1213
LanguageServerResolver,
@@ -67,7 +68,7 @@ describe('AmazonQLSPInstaller', () => {
6768
})
6869

6970
afterEach(async () => {
70-
delete process.env.AWS_LANGUAGE_SERVER_OVERRIDE
71+
delete process.env.__AMAZONQLSP_LOCATION_OVERRIDE
7172
sandbox.restore()
7273
await fs.delete(tempDir, {
7374
recursive: true,
@@ -79,9 +80,25 @@ describe('AmazonQLSPInstaller', () => {
7980
})
8081

8182
describe('resolve()', () => {
82-
it('uses AWS_LANGUAGE_SERVER_OVERRIDE', async () => {
83+
it('uses dev setting override', async () => {
84+
const locationOverride = '/custom/path/to/lsp'
85+
const serviceConfigStub = sandbox.stub().returns({
86+
locationOverride,
87+
})
88+
sandbox.stub(DevSettings, 'instance').get(() => ({
89+
getServiceConfig: serviceConfigStub,
90+
}))
91+
92+
const result = await resolver.resolve()
93+
94+
assert.strictEqual(result.assetDirectory, locationOverride)
95+
assert.strictEqual(result.location, 'override')
96+
assert.strictEqual(result.version, '0.0.0')
97+
})
98+
99+
it('uses environment variable override', async () => {
83100
const overridePath = '/custom/path/to/lsp'
84-
process.env.AWS_LANGUAGE_SERVER_OVERRIDE = overridePath
101+
process.env.__AMAZONQLSP_LOCATION_OVERRIDE = overridePath
85102

86103
const result = await resolver.resolve()
87104

0 commit comments

Comments
 (0)