Skip to content

Commit

Permalink
feat(scripts): throw error if component type is not available
Browse files Browse the repository at this point in the history
Co-authored-by: Clément Latzarus <[email protected]>
Co-authored-by: Diane Cordier <[email protected]>
Co-authored-by: Eric Lim <[email protected]>
  • Loading branch information
4 people committed Jan 6, 2025
1 parent a369fea commit a1118a4
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions api/tests/devcomp/unit/scripts/get-modules-csv_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,24 @@ describe.only('when get total of elements', function () {
// then
expect(result).to.equal(2);
});

it('should throw if component type is not available', function () {
// given
const grains = [
{
components: [
{
type: 'non-existing-component-type',
},
],
},
];

// when
const err = catchErrSync(_getTotalElements)(grains);

// then
expect(err).to.be.an.instanceOf(Error);
expect(err.message).to.equal('Component type "non-existing-component-type" is not available');
});
});

0 comments on commit a1118a4

Please sign in to comment.