Skip to content

Commit edd559c

Browse files
committed
use fsPath instead of path
1 parent 6c8ca76 commit edd559c

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

packages/core/src/test/awsService/ec2/model.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,12 @@ describe('Ec2ConnectClient', function () {
156156
region: 'test-region',
157157
}
158158
const testWorkspaceFolder = await createTestWorkspaceFolder()
159-
const keyPath = path.join(testWorkspaceFolder.uri.path, 'key')
159+
const keyPath = path.join(testWorkspaceFolder.uri.fsPath, 'key')
160160
const keys = await SshKeyPair.getSshKeyPair(keyPath, 60000)
161161
await client.sendSshKeyToInstance(testSelection, keys, 'test-user')
162162
const privKey = await fs.readFileText(keyPath)
163163
assertNoTelemetryMatch(privKey)
164164
sinon.restore()
165-
166165
await fs.delete(testWorkspaceFolder.uri, { recursive: true, force: true })
167166
})
168167
})

packages/core/src/test/awsService/ec2/sshKeyPair.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
5-
import * as vscode from 'vscode'
65
import assert from 'assert'
76
import nodefs from 'fs' // eslint-disable-line no-restricted-imports
87
import * as sinon from 'sinon'
@@ -14,7 +13,7 @@ import { InstalledClock } from '@sinonjs/fake-timers'
1413
import { ChildProcess } from '../../../shared/utilities/processUtils'
1514
import { fs, globals } from '../../../shared'
1615

17-
describe('SshKeyUtility', async function () {
16+
describe('SshKeyPair', async function () {
1817
let temporaryDirectory: string
1918
let keyPath: string
2019
let keyPair: SshKeyPair
@@ -90,10 +89,10 @@ describe('SshKeyUtility', async function () {
9089

9190
it('does overwrite existing keys on get call', async function () {
9291
const generateStub = sinon.spy(SshKeyPair, 'generateSshKeyPair')
93-
const keyBefore = await fs.readFileBytes(vscode.Uri.file(keyPath))
92+
const keyBefore = await fs.readFileBytes(keyPath)
9493
keyPair = await SshKeyPair.getSshKeyPair(keyPath, 30000)
9594

96-
const keyAfter = await fs.readFileBytes(vscode.Uri.file(keyPath))
95+
const keyAfter = await fs.readFileBytes(keyPath)
9796
sinon.assert.calledOnce(generateStub)
9897

9998
assert.notStrictEqual(keyBefore, keyAfter)

0 commit comments

Comments
 (0)