diff --git a/packages/core/src/test/awsService/appBuilder/walkthrough.test.ts b/packages/core/src/test/awsService/appBuilder/walkthrough.test.ts index 9700b756c23..72dfb5c0ae2 100644 --- a/packages/core/src/test/awsService/appBuilder/walkthrough.test.ts +++ b/packages/core/src/test/awsService/appBuilder/walkthrough.test.ts @@ -25,6 +25,7 @@ import { ChildProcess } from '../../../shared/utilities/processUtils' import { assertTelemetryCurried } from '../../testUtil' import { HttpResourceFetcher } from '../../../shared/resourcefetcher/httpResourceFetcher' import { SamCliInfoInvocation } from '../../../shared/sam/cli/samCliInfo' +import { CodeScansState } from '../../../codewhisperer' interface TestScenario { toolID: AwsClis @@ -81,6 +82,12 @@ const scenarios: TestScenario[] = [ ] describe('AppBuilder Walkthrough', function () { + before(async function () { + // ensure auto scan is disabled before testrun + await CodeScansState.instance.setScansEnabled(false) + assert.strictEqual(CodeScansState.instance.isScansEnabled(), false) + }) + describe('Reopen template after reload', function () { let sandbox: sinon.SinonSandbox let spyExecuteCommand: sinon.SinonSpy diff --git a/packages/core/src/test/codewhisperer/commands/basicCommands.test.ts b/packages/core/src/test/codewhisperer/commands/basicCommands.test.ts index ee6aa81bbe0..8455a084fb0 100644 --- a/packages/core/src/test/codewhisperer/commands/basicCommands.test.ts +++ b/packages/core/src/test/codewhisperer/commands/basicCommands.test.ts @@ -74,6 +74,12 @@ describe('CodeWhisperer-basicCommands', function () { sinon.restore() }) + after(async function () { + // disable auto scan after testrun + await CodeScansState.instance.setScansEnabled(false) + assert.strictEqual(CodeScansState.instance.isScansEnabled(), false) + }) + describe('toggleCodeSuggestion', function () { class TestCodeSuggestionsState extends CodeSuggestionsState { public constructor(initialState?: boolean) { @@ -88,12 +94,6 @@ describe('CodeWhisperer-basicCommands', function () { codeSuggestionsState = new TestCodeSuggestionsState() }) - after(async function () { - // disable auto scan after testrun - await CodeScansState.instance.setScansEnabled(false) - assert.strictEqual(CodeScansState.instance.isScansEnabled(), false) - }) - it('has suggestions enabled by default', async function () { targetCommand = testCommand(toggleCodeSuggestions, codeSuggestionsState) assert.strictEqual(codeSuggestionsState.isSuggestionsEnabled(), true)