conventional-commits-parser
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -0,1 +1,11 @@ | ||
<a name="1.2.1"></a> | ||
## [1.2.1](https://github.com/conventional-changelog/conventional-commits-parser/compare/v1.2.0...v1.2.1) (2016-04-24) | ||
### Bug Fixes | ||
* **mention:** fix mention matching ([43b32e7](https://github.com/conventional-changelog/conventional-commits-parser/commit/43b32e7)), closes [#26](https://github.com/conventional-changelog/conventional-commits-parser/issues/26) | ||
<a name="1.2.0"></a> | ||
@@ -2,0 +12,0 @@ # [1.2.0](https://github.com/conventional-changelog/conventional-commits-parser/compare/v1.1.0...v1.2.0) (2016-04-15) |
@@ -52,4 +52,4 @@ 'use strict'; | ||
references: reReferences, | ||
mentions: /@(\S+)/g | ||
mentions: /@([\w-]+)/g | ||
}; | ||
}; |
{ | ||
"name": "conventional-commits-parser", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Parse raw conventional commits", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/conventional-changelog/conventional-commits-parser", |
@@ -242,2 +242,67 @@ 'use strict'; | ||
}); | ||
describe('mentions', function() { | ||
it('should match basically mention', function() { | ||
var string = 'Thanks!! @someone'; | ||
var mentions = regex().mentions; | ||
var match = mentions.exec(string); | ||
expect(match[0]).to.equal('@someone'); | ||
expect(match[1]).to.equal('someone'); | ||
}); | ||
it('should match mention with hyphen', function() { | ||
var string = 'Thanks!! @some-one'; | ||
var mentions = regex().mentions; | ||
var match = mentions.exec(string); | ||
expect(match[0]).to.equal('@some-one'); | ||
expect(match[1]).to.equal('some-one'); | ||
}); | ||
it('should match mention with underscore', function() { | ||
var string = 'Thanks!! @some_one'; | ||
var mentions = regex().mentions; | ||
var match = mentions.exec(string); | ||
expect(match[0]).to.equal('@some_one'); | ||
expect(match[1]).to.equal('some_one'); | ||
}); | ||
it('should match mention with parentheses', function() { | ||
var string = 'Fix feature1 (by @someone)'; | ||
var mentions = regex().mentions; | ||
var match = mentions.exec(string); | ||
expect(match[0]).to.equal('@someone'); | ||
expect(match[1]).to.equal('someone'); | ||
}); | ||
it('should match mention with brackets', function() { | ||
var string = 'Fix feature1 [by @someone]'; | ||
var mentions = regex().mentions; | ||
var match = mentions.exec(string); | ||
expect(match[0]).to.equal('@someone'); | ||
expect(match[1]).to.equal('someone'); | ||
}); | ||
it('should match mention with braces', function() { | ||
var string = 'Fix feature1 {by @someone}'; | ||
var mentions = regex().mentions; | ||
var match = mentions.exec(string); | ||
expect(match[0]).to.equal('@someone'); | ||
expect(match[1]).to.equal('someone'); | ||
}); | ||
it('should match mention with angle brackets', function() { | ||
var string = 'Fix feature1 by <@someone>'; | ||
var mentions = regex().mentions; | ||
var match = mentions.exec(string); | ||
expect(match[0]).to.equal('@someone'); | ||
expect(match[1]).to.equal('someone'); | ||
}); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
79463
1795