Skip to content

Commit 314950d

Browse files
committed
version unit test need to support all semver formats
1 parent 91e24f7 commit 314950d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/b2c-tooling-sdk/test/version.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ describe('version', () => {
2424
expect(SDK_USER_AGENT).to.equal(`${pkg.name.replace(/^@salesforce\//, '')}/${pkg.version}`);
2525
});
2626

27-
it('SDK_USER_AGENT is b2c-tooling-sdk/x.x.x format', () => {
28-
expect(SDK_USER_AGENT).to.match(/^b2c-tooling-sdk\/\d+\.\d+\.\d+$/);
27+
it('SDK_USER_AGENT is b2c-tooling-sdk/x.x.x format (with optional prerelease)', () => {
28+
// Allow semver with optional prerelease suffix (e.g., 0.0.0-nightly.20260122)
29+
expect(SDK_USER_AGENT).to.match(/^b2c-tooling-sdk\/\d+\.\d+\.\d+(-[\w.]+)?$/);
2930
});
3031
});

0 commit comments

Comments
 (0)