File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ import { Ec2Client } from '../../shared/clients/ec2Client'
11
11
import { Ec2Selection } from '../../ec2/utils'
12
12
import { ToolkitError } from '../../shared/errors'
13
13
import { IAM } from 'aws-sdk'
14
- import { mock } from 'ts-mockito'
15
14
import { SshKeyPair } from '../../ec2/sshKeyPair'
16
15
import { DefaultIamClient } from '../../shared/clients/iamClient'
17
16
@@ -160,12 +159,12 @@ describe('Ec2ConnectClient', function () {
160
159
describe ( 'sendSshKeysToInstance' , async function ( ) {
161
160
it ( 'calls the sdk with the proper parameters' , async function ( ) {
162
161
const sendCommandStub = sinon . stub ( SsmClient . prototype , 'sendCommandAndWait' )
163
-
162
+ sinon . stub ( SshKeyPair , 'generateSshKeyPair' )
164
163
const testSelection = {
165
164
instanceId : 'test-id' ,
166
165
region : 'test-region' ,
167
166
}
168
- const mockKeys = mock ( ) as SshKeyPair
167
+ const mockKeys = await SshKeyPair . getSshKeyPair ( '' )
169
168
await client . sendSshKeyToInstance ( testSelection , mockKeys , '' )
170
169
sinon . assert . calledWith ( sendCommandStub , testSelection . instanceId , 'AWS-RunShellScript' )
171
170
sinon . restore ( )
You can’t perform that action at this time.
0 commit comments