diff --git a/test/unit/specs/services/version/version.service.spec.js b/test/unit/specs/services/version/version.service.spec.js new file mode 100644 index 0000000000..519145ee1d --- /dev/null +++ b/test/unit/specs/services/version/version.service.spec.js @@ -0,0 +1,11 @@ +import { extractCommit } from 'src/services/version/version.service.js' + +describe('extractCommit', () => { + it('return short commit hash following "-g" characters', () => { + expect(extractCommit('1.0.0-45-g5e7aeebc')).to.eql('5e7aeebc') + }) + + it('return short commit hash without branch name', () => { + expect(extractCommit('1.0.0-45-g5e7aeebc-branch')).to.eql('5e7aeebc') + }) +})