Skip to content

Commit

Permalink
test: default value for registry and ut adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Aug 9, 2024
1 parent 099d1d4 commit 3c5276b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/shared/metadataKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const mappingsForSourceMemberTypesToMetadataType = new Map<string, string
]);

export const registrySupportsType =
(registry: RegistryAccess) =>
(registry: RegistryAccess = new RegistryAccess()) =>
(type: string): boolean => {
if (mappingsForSourceMemberTypesToMetadataType.has(type)) {
return true;
Expand Down
10 changes: 5 additions & 5 deletions test/unit/metadataKeys.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ describe('metadataKeys', () => {

describe('registrySupportsType', () => {
it('custom mapped types', () => {
expect(registrySupportsType('AuraDefinition')).to.equal(true);
expect(registrySupportsType('LightningComponentResource')).to.equal(true);
expect(registrySupportsType()('AuraDefinition')).to.equal(true);
expect(registrySupportsType()('LightningComponentResource')).to.equal(true);
});
it('other real types types', () => {
expect(registrySupportsType('CustomObject')).to.equal(true);
expect(registrySupportsType('ApexClass')).to.equal(true);
expect(registrySupportsType()('CustomObject')).to.equal(true);
expect(registrySupportsType()('ApexClass')).to.equal(true);
});
it('bad type returns false and emits warning', async () => {
const warningEmitted: string[] = [];
Expand All @@ -124,7 +124,7 @@ describe('registrySupportsType', () => {
warningEmitted.push(w);
return Promise.resolve();
});
expect(registrySupportsType(badType)).to.equal(false);
expect(registrySupportsType()(badType)).to.equal(false);
expect(
warningEmitted.some((w) => w.includes(badType)),
'warning not emitted'
Expand Down

0 comments on commit 3c5276b

Please sign in to comment.