Skip to content

Commit

Permalink
added empty should not fail (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
fuxingloh authored Jan 14, 2021
1 parent e3ea0c5 commit 8230f92
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
8 changes: 8 additions & 0 deletions __tests__/fixtures/empty.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: v1

labels:
- label: "feat"
- label: "fix"
- label: "chore"
- label: "docs"

14 changes: 13 additions & 1 deletion __tests__/labeler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe('main core and context', () => {
})

it('should be able to load default config', async function () {
await run('abc', '.github/labeler.yml')
await run('token', '.github/labeler.yml')
})

it('no issue or pr should fail', async function () {
Expand All @@ -83,6 +83,18 @@ describe('main core and context', () => {
)
})

it('empty should not fail', async function () {
github.context.payload = {
pull_request: {
number: 1,
title: 'nothing',
body: 'nothing'
}
}

await run('token', '__tests__/fixtures/empty.yml')
});

describe('basic.yml', () => {
beforeEach(async () => {
labels = []
Expand Down

0 comments on commit 8230f92

Please sign in to comment.