mirror of
https://github.com/FranzDiebold/github-env-vars-action.git
synced 2024-11-06 01:05:50 -05:00
Improve tests.
This commit is contained in:
parent
852ab6388c
commit
4454a4b968
1 changed files with 12 additions and 7 deletions
|
@ -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();
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue