Skip to content

Commit

Permalink
test(generateScratchOrgInfo): add unit test on $schema key removal fr…
Browse files Browse the repository at this point in the history
…om ScratchOrgInfo json
  • Loading branch information
alanjaouen committed Aug 7, 2024
1 parent 9501de5 commit 4a5fdd9
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/unit/org/scratchOrgInfoGenerator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1026,5 +1026,25 @@ describe('scratchOrgInfoGenerator', () => {
expect(err).to.exist;
}
});
it('Remove $schema key if it exist', async () => {
sandbox.restore();
stubMethod(sandbox, fs.promises, 'readFile')
.withArgs('./my-file.json', 'utf8')
.resolves(
'{ "$schema": "https://forcedotcom.github.io/schemas/project-scratch-def.json/project-scratch-def.schema.json" }'
);
expect(
await getScratchOrgInfoPayload({
durationDays: 1,
definitionfile: './my-file.json',
})
).to.deep.equal({
scratchOrgInfoPayload: {
durationDays: 1,
},
ignoreAncestorIds: false,
warnings: [],
});
});
});
});

0 comments on commit 4a5fdd9

Please sign in to comment.