-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(coverage): you live by 100% test coverage, you die by 100% test …
…coverage
- Loading branch information
Ahmad Nassri
committed
Aug 20, 2020
1 parent
a0d2c83
commit b81ed45
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
}) |