Skip to content

Commit

Permalink
test(coverage): you live by 100% test coverage, you die by 100% test …
Browse files Browse the repository at this point in the history
…coverage
  • Loading branch information
Ahmad Nassri committed Aug 20, 2020
1 parent a0d2c83 commit b81ed45
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
22 changes: 22 additions & 0 deletions action/test/pre-release-target.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// packages
const { test } = require('tap')
const sinon = require('sinon')
const core = require('@actions/core')

// module
const parse = require('../lib/parse')

test('title -> parse', async assert => {
assert.plan(4)

sinon.stub(core, 'info')

const command = parse('chore(deps): bump api-problem from 6.1.2 to 6.1.4-prerelease in /path', 'preminor')

assert.ok(core.info.called)
assert.equal(core.info.getCall(2).args[0], 'to: 6.1.4-prerelease')
assert.equal(core.info.getCall(3).args[0], 'dependency update target is "preminor", found "prepatch", will auto-merge')
assert.equal(command, 'merge')

core.info.restore()
})
22 changes: 22 additions & 0 deletions action/test/pre-release-version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// packages
const { test } = require('tap')
const sinon = require('sinon')
const core = require('@actions/core')

// module
const parse = require('../lib/parse')

test('title -> parse', async assert => {
assert.plan(4)

sinon.stub(core, 'info')

const command = parse('chore(deps): bump api-problem from 6.1.2 to 6.1.4-prerelease in /path', 'major')

assert.ok(core.info.called)
assert.equal(core.info.getCall(2).args[0], 'to: 6.1.4-prerelease')
assert.equal(core.info.getCall(3).args[0], 'dependency update target is "major", found "prepatch", will auto-merge')
assert.equal(command, 'merge')

core.info.restore()
})

0 comments on commit b81ed45

Please sign in to comment.