Skip to content

Commit eb4e7dc

Browse files
committed
ensure it's turned off
1 parent f42f191 commit eb4e7dc

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

packages/core/src/test/awsService/appBuilder/walkthrough.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { ChildProcess } from '../../../shared/utilities/processUtils'
2525
import { assertTelemetryCurried } from '../../testUtil'
2626
import { HttpResourceFetcher } from '../../../shared/resourcefetcher/httpResourceFetcher'
2727
import { SamCliInfoInvocation } from '../../../shared/sam/cli/samCliInfo'
28+
import { CodeScansState } from '../../../codewhisperer'
2829

2930
interface TestScenario {
3031
toolID: AwsClis
@@ -81,6 +82,12 @@ const scenarios: TestScenario[] = [
8182
]
8283

8384
describe('AppBuilder Walkthrough', function () {
85+
before(async function () {
86+
// ensure auto scan is disabled before testrun
87+
await CodeScansState.instance.setScansEnabled(false)
88+
assert.strictEqual(CodeScansState.instance.isScansEnabled(), false)
89+
})
90+
8491
describe('Reopen template after reload', function () {
8592
let sandbox: sinon.SinonSandbox
8693
let spyExecuteCommand: sinon.SinonSpy

packages/core/src/test/codewhisperer/commands/basicCommands.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ describe('CodeWhisperer-basicCommands', function () {
7474
sinon.restore()
7575
})
7676

77+
after(async function () {
78+
// disable auto scan after testrun
79+
await CodeScansState.instance.setScansEnabled(false)
80+
assert.strictEqual(CodeScansState.instance.isScansEnabled(), false)
81+
})
82+
7783
describe('toggleCodeSuggestion', function () {
7884
class TestCodeSuggestionsState extends CodeSuggestionsState {
7985
public constructor(initialState?: boolean) {
@@ -88,12 +94,6 @@ describe('CodeWhisperer-basicCommands', function () {
8894
codeSuggestionsState = new TestCodeSuggestionsState()
8995
})
9096

91-
after(async function () {
92-
// disable auto scan after testrun
93-
await CodeScansState.instance.setScansEnabled(false)
94-
assert.strictEqual(CodeScansState.instance.isScansEnabled(), false)
95-
})
96-
9797
it('has suggestions enabled by default', async function () {
9898
targetCommand = testCommand(toggleCodeSuggestions, codeSuggestionsState)
9999
assert.strictEqual(codeSuggestionsState.isSuggestionsEnabled(), true)

0 commit comments

Comments
 (0)