Skip to content

Commit 13060ac

Browse files
committed
fix failing tests
1 parent af70dea commit 13060ac

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

packages/core/src/test/awsService/appBuilder/explorer/samProject.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ describe('samProject', () => {
6464
assert.equal(region, undefined)
6565
})
6666

67-
it('returns {} when (unlikely) given an undefind project root uri', async () => {
67+
it('returns {} when (unlikely) given an undefined project root uri', async () => {
6868
const wrapperCall = async (projectRootUri: any) => {
6969
return await getStackName(projectRootUri)
7070
}
7171

7272
const result = await wrapperCall(undefined)
7373
assert.deepStrictEqual(result, {})
74-
assertLogsContain('Error getting stack name or region information: No project folder found', true, 'warn')
74+
assertLogsContain('Error getting stack name or region information: No project folder found', false, 'warn')
7575
})
7676

7777
it('returns empty object give no samconfig file found', async () => {

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,32 +42,36 @@ describe('SchemaService', function () {
4242

4343
it('assigns schemas to the yaml extension', async function () {
4444
const stub = sinon.stub()
45+
const fooUri = vscode.Uri.parse('/foo')
46+
const barUri = vscode.Uri.parse('/bar')
4547
fakeYamlExtension.assignSchema = stub
4648
service.registerMapping({
47-
uri: vscode.Uri.parse('/foo'),
49+
uri: fooUri,
4850
type: 'yaml',
4951
schema: 'cfn',
5052
})
5153
service.registerMapping({
52-
uri: vscode.Uri.parse('/bar'),
54+
uri: barUri,
5355
type: 'yaml',
5456
schema: 'sam',
5557
})
5658
await service.processUpdates()
57-
assert(stub.firstCall.calledWithExactly(vscode.Uri.file('/foo'), cfnSchema))
58-
assert(stub.secondCall.calledWithExactly(vscode.Uri.file('/bar'), samSchema))
59+
assert.ok(stub.firstCall.args[0])
60+
assert(stub.firstCall.calledWithExactly(fooUri, cfnSchema))
61+
assert(stub.secondCall.calledWithExactly(barUri, samSchema))
5962
})
6063

6164
it('removes schemas from the yaml extension', async function () {
6265
const stub = sinon.stub()
66+
const fooUri = vscode.Uri.parse('/foo')
6367
fakeYamlExtension.removeSchema = stub
6468
service.registerMapping({
65-
uri: vscode.Uri.parse('/foo'),
69+
uri: fooUri,
6670
type: 'yaml',
6771
schema: undefined,
6872
})
6973
await service.processUpdates()
70-
assert(stub.calledOnceWithExactly(vscode.Uri.file('/foo')))
74+
assert(stub.calledOnceWithExactly(fooUri))
7175
})
7276

7377
it('registers schemas to json configuration', async function () {

0 commit comments

Comments
 (0)