Skip to content

Commit

Permalink
Expect last added resource from findResourceInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
mint-thompson committed Aug 22, 2024
1 parent 54ac727 commit 17ab796
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions test/db/SQLJSPackageDB.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -514,17 +514,8 @@ describe('SQLJSPackageDB', () => {
const resource = packageDb.findResourceInfo('my-value-set');
expect(resource).toBeDefined();
// both valueSetThree and valueSetFour have a matching id,
// so either packageVersion is acceptable.
expect(resource).toEqual(
expect.objectContaining({
resourceType: 'ValueSet',
id: 'my-value-set',
url: 'http://example.org/ValueSets/my-value-set',
name: 'MyValueSet',
packageName: 'RegularPackage',
packageVersion: expect.stringMatching(/^(3\.2\.2|4\.5\.6)$/)
})
);
// but the last resource added wins.
expect(resource).toEqual(expect.objectContaining(valueSetFour));
});

it('should return undefined when there are no matches', () => {
Expand Down

0 comments on commit 17ab796

Please sign in to comment.