Skip to content

Commit

Permalink
linting files
Browse files Browse the repository at this point in the history
  • Loading branch information
KaelynJefferson committed Aug 27, 2024
1 parent a95167c commit ec1e970
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
13 changes: 6 additions & 7 deletions src/export/ValueSetExporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ export class ValueSetExporter {
return this.fisher.fishForMetadata(vs, Type.ValueSet)?.url ?? vs;
});
composeElement.valueSet = composeElement.valueSet.filter(vs => {
if (vs == valueSet.url) {
logger.error(
`Value set with id ${valueSet.id} has component rule with self referencing value set (by id, value set name, or url). Skipping rule.`
);
};
return vs != valueSet.url
if (vs == valueSet.url) {
logger.error(
`Value set with id ${valueSet.id} has component rule with self referencing value set (by id, value set name, or url). Skipping rule.`
);
}
return vs != valueSet.url;
});
composeElement.valueSet.forEach(vs => {
// Canonical URI may include | to specify version: https://www.hl7.org/fhir/references.html#canonical
Expand Down Expand Up @@ -456,7 +456,6 @@ export class ValueSetExporter {
);
}


cleanResource(vs, (prop: string) => ['_sliceName', '_primitive'].includes(prop));
this.pkg.valueSets.push(vs);
this.pkg.fshMap.set(vs.getFileName(), {
Expand Down
6 changes: 4 additions & 2 deletions test/export/ValueSetExporter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ describe('ValueSetExporter', () => {

it('should log error when exporting a value set that includes a component from a self referencing value set', () => {
const valueSet = new FshValueSet('DinnerVS');
valueSet.id = "dinner-vs"
valueSet.id = 'dinner-vs';
const component = new ValueSetConceptComponentRule(true);
component.from = {
valueSets: [
Expand Down Expand Up @@ -508,7 +508,9 @@ describe('ValueSetExporter', () => {
}
});
expect(loggerSpy.getAllMessages('error')).toHaveLength(3);
expect(loggerSpy.getLastMessage('error')).toBe('Value set with id dinner-vs has component rule with self referencing value set (by id, value set name, or url). Skipping rule.');
expect(loggerSpy.getLastMessage('error')).toBe(
'Value set with id dinner-vs has component rule with self referencing value set (by id, value set name, or url). Skipping rule.'
);
});

it('should export a value set that includes a concept component with at least one concept', () => {
Expand Down

0 comments on commit ec1e970

Please sign in to comment.