diff --git a/index.test.js b/index.test.js index d297855..4fcc96b 100644 --- a/index.test.js +++ b/index.test.js @@ -19,30 +19,35 @@ test('gets repository owner', () => { .toEqual('FranzDiebold'); }); -test('gets repository owner for empty GITHUB_REPOSITORY', () => { +test('gets repository owner for empty repository', () => { expect(getRepositoryOwner(undefined)).toBeFalsy(); }); -test('gets repository name', () => { +test('gets repository name from repository', () => { expect(getRepositoryName('FranzDiebold/github-env-vars-action')) .toEqual('github-env-vars-action'); }); -test('gets repository name for empty GITHUB_REPOSITORY', () => { +test('gets repository name for empty repository', () => { expect(getRepositoryName(undefined)).toBeFalsy(); }); -test('gets ref from simple ref name', () => { +test('gets ref name from simple ref', () => { expect(getRefName('refs/heads/feature-branch-1')) .toEqual('feature-branch-1'); }); -test('gets ref from complex ref name', () => { +test('gets ref name from tag', () => { + expect(getRefName('refs/tags/v1.3.7')) + .toEqual('v1.3.7'); +}); + +test('gets ref name from complex ref', () => { expect(getRefName('refs/heads/feat/feature-branch-1')) .toEqual('feat/feature-branch-1'); }); -test('gets repository name for empty GITHUB_REF_NAME', () => { +test('gets ref name for empty ref', () => { expect(getRefName(undefined)).toBeFalsy(); }); @@ -51,6 +56,6 @@ test('gets short SHA', () => { .toEqual('ffac537e'); }); -test('gets short SHA for empty GITHUB_SHA', () => { +test('gets short SHA for empty SHA', () => { expect(getShaShort(undefined)).toBeFalsy(); });