Skip to content

Commit 6e69c05

Browse files
authored
test: failing IAMPolicy check test #5714
## Problem There is a test from recent PR that is incorrect given current structure. Ex. https://github.com/aws/aws-toolkit-vscode/actions/runs/11149044046/job/30987024464 Using `globals.context.asAbsolutePath` will prepend `toolkit` to the path, whereas we want to look in `core` for this file. ## Solution - Manually construct the path to be checked.
1 parent ee917c0 commit 6e69c05

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/core/src/test/awsService/accessanalyzer/iamPolicyChecks.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import * as iamPolicyChecks from '../../../awsService/accessanalyzer/vue/iamPoli
1919
import * as vscode from 'vscode'
2020
import { IamPolicyChecksConstants } from '../../../awsService/accessanalyzer/vue/constants'
2121
import { FileSystem } from '../../../shared/fs/fs'
22+
import path from 'path'
2223

2324
const defaultTerraformConfigPath = 'resources/policychecks-tf-default.yaml'
2425
let sandbox: sinon.SinonSandbox
@@ -29,7 +30,10 @@ describe('iamPolicyChecks', function () {
2930
it('IamPolicyChecksWebview built .vue source file path exists', async function () {
3031
assert.ok(
3132
await vscodeFs.existsFile(
32-
globals.context.asAbsolutePath(`src/awsService/accessanalyzer/vue/iamPolicyChecks.vue`)
33+
path.join(
34+
path.dirname(globals.context.extensionPath),
35+
`core/src/awsService/accessanalyzer/vue/iamPolicyChecks.vue`
36+
)
3337
)
3438
)
3539
})

0 commit comments

Comments
 (0)