Skip to content

Commit 12cf3ec

Browse files
committed
fix tests
1 parent 61f95f0 commit 12cf3ec

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

packages/core/src/shared/sam/debugger/typescriptSamDebug.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { findParentProjectFile } from '../../utilities/workspaceUtils'
1616
import { DefaultSamLocalInvokeCommand, waitForDebuggerMessages } from '../cli/samCliLocalInvoke'
1717
import { runLambdaFunction, waitForPort } from '../localLambdaRunner'
1818
import { SamLaunchRequestArgs } from './awsSamDebugger'
19-
import { findTypescriptCompiler } from '../../utilities/pathFinder'
19+
import { pathFinder } from '../../utilities/pathFinder'
2020
import fs from '../../fs/fs'
2121

2222
const tsConfigFile = 'aws-toolkit-tsconfig.json'
@@ -209,7 +209,7 @@ async function compileTypeScript(config: SamLaunchRequestArgs): Promise<void> {
209209
config.invokeTarget.lambdaHandler = pathutil.normalizeSeparator(tsLambdaHandler)
210210
getLogger().info(`Resolved compiled lambda handler to ${tsLambdaHandler}`)
211211

212-
const tsc = await findTypescriptCompiler()
212+
const tsc = await pathFinder.findTypescriptCompiler()
213213
if (!tsc) {
214214
throw new Error('TypeScript compiler "tsc" not found in node_modules/ or the system.')
215215
}

packages/core/src/shared/utilities/pathFinder.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { GitExtension } from '../extensions/git'
1111
import { Settings } from '../settings'
1212
import { getLogger } from '../logger/logger'
1313

14-
type searchablePath = 'vsc' | 'ssh' | 'git' | 'bash' | 'tsc'
14+
type searchablePath = 'vsc' | 'ssh' | 'git' | 'bash'
1515

1616
export class PathFinder {
1717
private cachedPaths: Map<searchablePath, string>
@@ -94,9 +94,6 @@ export class PathFinder {
9494
* @returns fullpath if found in the workspace, "tsc" if found in current $PATH, else undefined.
9595
*/
9696
public async findTypescriptCompiler(): Promise<string | undefined> {
97-
if (this.cachedPaths.has('tsc')) {
98-
return this.cachedPaths.get('tsc')
99-
}
10097
const foundUris = await vscode.workspace.findFiles('**/node_modules/.bin/{tsc,tsc.cmd}', undefined, 1)
10198
const tscPaths = []
10299
if (foundUris.length > 0) {
@@ -107,7 +104,6 @@ export class PathFinder {
107104
for (const tsc of tscPaths) {
108105
// Try to run "tsc -v".
109106
if (await PathFinder.tryRun(tsc, ['-v'], 'yes', 'Version')) {
110-
this.cachedPaths.set('tsc', tsc)
111107
return tsc
112108
}
113109
}

packages/core/src/test/shared/remoteSession.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { minimumSsmActions } from '../../shared/remoteSession'
77

88
describe('minimumSsmActions', function () {
99
it('should contain minimal actions needed for ssm connection', function () {
10-
assert.strictEqual(minimumSsmActions, [
10+
assert.deepStrictEqual(minimumSsmActions, [
1111
'ssmmessages:CreateControlChannel',
1212
'ssmmessages:CreateDataChannel',
1313
'ssmmessages:OpenControlChannel',

0 commit comments

Comments
 (0)