-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2bfb28d
commit 3d84a18
Showing
2 changed files
with
78 additions
and
3 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
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,58 @@ | ||
'use strict'; | ||
|
||
|
||
const chai = require('chai'); | ||
const expect = chai.expect; | ||
const sinonChai = require('sinon-chai'); | ||
const chaiAsPromised = require("chai-as-promised"); | ||
|
||
const changelog = require('../tasks/git_changelog_generate'); | ||
|
||
chai.use(sinonChai); | ||
chai.use(chaiAsPromised); | ||
|
||
describe('parse_commits.spec.js', function() { | ||
|
||
before(function() { | ||
|
||
}); | ||
|
||
describe('Changelog()', function() { | ||
|
||
|
||
describe('.isPRMergeCommit()', function() { | ||
it('pr merge commits without scope', function() { | ||
const msg = changelog.parseRawCommit( | ||
'9b1aff905b638aa274a5fc8f88662df446d374bd\n' + | ||
'Merge pull request #187 from org/test-repo\n' + | ||
'fix: Fixed problem with deactivating last token.\n' + | ||
'Some output line\n' + | ||
'Some additional output line \n'); | ||
|
||
expect(msg.type).to.equal('fix'); | ||
expect(msg.hash).to.equal('9b1aff905b638aa274a5fc8f88662df446d374bd'); | ||
expect(msg.subject).to.equal('Fixed problem with deactivating last token.'); | ||
expect(msg.body).to.equal('Some output line\n' + | ||
'Some additional output line \n'); | ||
expect(msg.component).to.equal(undefined); | ||
}); | ||
|
||
it('pr merge commits with scope', function() { | ||
const msg = changelog.parseRawCommit( | ||
'9b1aff905b638aa274a5fc8f88662df446d374bd\n' + | ||
'Merge pull request #187 from org/test-repo\n' + | ||
'fix(public): Fixed problem with deactivating last token.\n' + | ||
'Some output line\n' + | ||
'Some additional output line \n'); | ||
|
||
expect(msg.type).to.equal('fix'); | ||
expect(msg.hash).to.equal('9b1aff905b638aa274a5fc8f88662df446d374bd'); | ||
expect(msg.subject).to.equal('Fixed problem with deactivating last token.'); | ||
expect(msg.body).to.equal('Some output line\n' + | ||
'Some additional output line \n'); | ||
expect(msg.component).to.equal("public"); | ||
}); | ||
}); | ||
}); | ||
|
||
}); |