Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
adamzolyak committed Jan 21, 2019
1 parent 3096ca8 commit 1623d40
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"main": "app.js",
"scripts": {
"start": "node app.js",
"test": "GITHUB_TOKEN='00000' GITHUB_REPOSITORY='waffleio/waffle.io' GITHUB_EVENT_PATH='./tests/fixtures/actionTrigger.json' jest"
"test": "GITHUB_TOKEN='00000' GITHUB_REPOSITORY='adamzolyak/actions-playground' GITHUB_EVENT_PATH='./tests/fixtures/actionTrigger.json' jest"
},
"repository": {
"type": "git",
Expand Down
24 changes: 16 additions & 8 deletions tests/helpers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ octokit.authenticate = jest.fn()

describe('getOwner', () => {
it('should return owner when passed GITHUB_REPOSITORY env variable', () => {
const result = helpers.getOwner('waffleio/waffle.io')
expect(result).toBe('waffleio')
const result = helpers.getOwner('adamzolyak/actions-playground')
expect(result).toBe('adamzolyak')
})
})

describe('getRepo', () => {
it('should return repo when passed GITHUB_REPOSITORY env variable', () => {
const result = helpers.getRepo('waffleio/waffle.io')
expect(result).toBe('waffle.io')
const result = helpers.getRepo('adamzolyak/actions-playground')
expect(result).toBe('actions-playground')
})
})

Expand Down Expand Up @@ -51,8 +51,8 @@ describe('addLabel', () => {

const result = await helpers.addLabel(
octokit,
'waffleio',
'waffle.io',
'adamzolyak',
'actions-playground',
'1',
'Incomplete Tasks'
)
Expand All @@ -79,7 +79,11 @@ describe('getRepoLabels', () => {
}
}

const result = await helpers.getRepoLabels(octokit, 'waffleio', 'waffle.io')
const result = await helpers.getRepoLabels(
octokit,
'adamzolyak',
'actions-playground'
)

expect(octokit.issues.listLabelsForRepo).toHaveBeenCalledTimes(1)
expect(result).toBe(repoLabels)
Expand All @@ -93,7 +97,11 @@ describe('getRepoLabels', () => {
}
}

const result = await helpers.getRepoLabels(octokit, 'waffleio', 'waffle.io')
const result = await helpers.getRepoLabels(
octokit,
'adamzolyak',
'actions-playground'
)

expect(octokit.issues.listLabelsForRepo).toHaveBeenCalledTimes(1)
expect(result).toBe(repoLabels)
Expand Down

0 comments on commit 1623d40

Please sign in to comment.