55
66import assert from 'assert'
77import { version } from 'vscode'
8- import { DevSettings } from '../../shared/settings'
98import { getClientId } from '../../shared/telemetry/util'
109import { FakeMemento } from '../fakeExtensionContext'
1110import { FakeAwsContext } from '../utilities/fakeAwsContext'
12- import { TestSettings } from '../utilities/testSettingsConfiguration'
1311import { GlobalState } from '../../shared/globalState'
1412import { AWSClientBuilderV3 , DefaultAWSClientBuilderV3 } from '../../shared/awsClientBuilderV3'
1513import { Client } from '@aws-sdk/smithy-client'
14+ import { extensionVersion } from '../../shared'
1615
1716describe ( 'DefaultAwsClientBuilderV3' , function ( ) {
1817 let builder : AWSClientBuilderV3
@@ -31,6 +30,7 @@ describe('DefaultAwsClientBuilderV3', function () {
3130 service . config . customUserAgent ! [ 0 ] [ 0 ] . replace ( '---Insiders' , '' ) ,
3231 `AWS-Toolkit-For-VSCode/testPluginVersion Visual-Studio-Code/${ version } ClientId/${ clientId } `
3332 )
33+ assert . strictEqual ( service . config . customUserAgent ! [ 0 ] [ 1 ] , extensionVersion )
3434 } )
3535
3636 it ( 'adds region to client' , async function ( ) {
@@ -54,41 +54,5 @@ describe('DefaultAwsClientBuilderV3', function () {
5454
5555 assert . strictEqual ( service . config . customUserAgent [ 0 ] [ 0 ] , 'CUSTOM USER AGENT' )
5656 } )
57-
58- it ( 'can use endpoint override' , async function ( ) {
59- const settings = new TestSettings ( )
60- await settings . update ( 'aws.dev.endpoints' , { foo : 'http://example.com' } )
61-
62- const service = await builder . createAwsService (
63- Client as any ,
64- {
65- customUserAgent : [ [ 'CUSTOM USER AGENT' ] ] ,
66- apiConfig : { metadata : { serviceId : 'foo' } } ,
67- } as any ,
68- undefined ,
69- undefined ,
70- new DevSettings ( settings )
71- )
72-
73- assert . strictEqual ( service . config . endpoint , 'http://example.com' )
74- } )
75-
76- it ( 'does not clobber endpoint setting if no override is present' , async function ( ) {
77- const settings = new TestSettings ( )
78-
79- const service = await builder . createAwsService (
80- Client as any ,
81- {
82- customUserAgent : 'CUSTOM USER AGENT' ,
83- apiConfig : { metadata : { serviceId : 'foo' } } ,
84- endpoint : 'http://example.com' ,
85- } as any ,
86- undefined ,
87- undefined ,
88- new DevSettings ( settings )
89- )
90-
91- assert . strictEqual ( service . config . endpoint , 'http://example.com' )
92- } )
9357 } )
9458} )
0 commit comments