Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
gastonfournier committed Dec 18, 2023
1 parent 57d6dbe commit b2f3ecf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/test/e2e/api/openapi/openapi.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ test('should serve the OpenAPI spec with a `version` property', async () => {
.expect((res) => {
const { version } = res.body.info;
// ensure there's no whitespace or leading `v`
expect(semver.clean(version)).toStrictEqual(version);
// clean removes +anything modifier from the version
expect(version).toMatch(
new RegExp(`^${semver.clean(version) ?? 'invalid semver'}`),
);

// ensure the version listed is valid semver
expect(semver.parse(version, { loose: false })).toBeTruthy();
Expand Down

0 comments on commit b2f3ecf

Please sign in to comment.