From 6062b8fcfae1e33bc9a011ab4325cabfbaf77630 Mon Sep 17 00:00:00 2001 From: Will Lo Date: Mon, 16 Dec 2024 17:33:24 -0800 Subject: [PATCH 1/2] t --- .../util/crossFileContextUtil.test.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/packages/amazonq/test/unit/codewhisperer/util/crossFileContextUtil.test.ts b/packages/amazonq/test/unit/codewhisperer/util/crossFileContextUtil.test.ts index 5203159eb58..7fbee283509 100644 --- a/packages/amazonq/test/unit/codewhisperer/util/crossFileContextUtil.test.ts +++ b/packages/amazonq/test/unit/codewhisperer/util/crossFileContextUtil.test.ts @@ -4,10 +4,11 @@ */ import assert from 'assert' +import * as FakeTimers from '@sinonjs/fake-timers' import * as vscode from 'vscode' import * as sinon from 'sinon' import * as crossFile from 'aws-core-vscode/codewhisperer' -import { aStringWithLineCount, createMockTextEditor } from 'aws-core-vscode/test' +import { aStringWithLineCount, createMockTextEditor, installFakeClock } from 'aws-core-vscode/test' import { FeatureConfigProvider, crossFileContextConfig } from 'aws-core-vscode/codewhisperer' import { assertTabCount, @@ -30,6 +31,15 @@ describe('crossFileContextUtil', function () { } let mockEditor: vscode.TextEditor + let clock: FakeTimers.InstalledClock + + before(function () { + clock = installFakeClock() + }) + + after(function () { + clock.uninstall() + }) afterEach(function () { sinon.restore() @@ -313,8 +323,8 @@ describe('crossFileContextUtil', function () { describe('full support', function () { // TODO: fix it - // const fileExtLists = ['java', 'js', 'ts', 'py', 'tsx', 'jsx'] - const fileExtLists = ['java'] + const fileExtLists = ['java', 'js', 'ts', 'py', 'tsx', 'jsx'] + // const fileExtLists = ['java'] before(async function () { this.timeout(60000) From e61beebb1055a3cd6aaca42773240fc6f4ecdfc4 Mon Sep 17 00:00:00 2001 From: Will Lo Date: Mon, 16 Dec 2024 17:47:18 -0800 Subject: [PATCH 2/2] a --- .../test/unit/codewhisperer/util/crossFileContextUtil.test.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/amazonq/test/unit/codewhisperer/util/crossFileContextUtil.test.ts b/packages/amazonq/test/unit/codewhisperer/util/crossFileContextUtil.test.ts index 7fbee283509..75825232d7c 100644 --- a/packages/amazonq/test/unit/codewhisperer/util/crossFileContextUtil.test.ts +++ b/packages/amazonq/test/unit/codewhisperer/util/crossFileContextUtil.test.ts @@ -322,9 +322,7 @@ describe('crossFileContextUtil', function () { }) describe('full support', function () { - // TODO: fix it const fileExtLists = ['java', 'js', 'ts', 'py', 'tsx', 'jsx'] - // const fileExtLists = ['java'] before(async function () { this.timeout(60000)