conventional-changelog-angular
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -31,3 +31,2 @@ 'use strict'; | ||
function issueUrl() { | ||
var url = null; | ||
if (pkgJson.repository && pkgJson.repository.url && ~pkgJson.repository.url.indexOf('github.com')) { | ||
@@ -38,4 +37,2 @@ var gitUrl = gufg(pkgJson.repository.url); | ||
return gitUrl + '/issues/'; | ||
} else { | ||
return url; | ||
} | ||
@@ -42,0 +39,0 @@ } |
{ | ||
"name": "conventional-changelog-angular", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "conventional-changelog angular preset", | ||
"main": "index.js", | ||
"scripts": { | ||
"coverage": "istanbul cover -x test.js _mocha -- -R spec --timeout 30000 && rm -rf ./coverage", | ||
"lint": "jshint *.js --exclude node_modules && jscs *.js", | ||
"test": "mocha --timeout 30000 && npm run-script lint" | ||
"test": "mocha --timeout 30000 && npm run-script lint", | ||
"test-windows": "mocha --timeout 30000" | ||
}, | ||
@@ -27,5 +27,5 @@ "repository": { | ||
"devDependencies": { | ||
"better-than-before": "^1.0.0", | ||
"chai": "^3.4.1", | ||
"conventional-changelog-core": "^1.0.1", | ||
"coveralls": "^2.11.6", | ||
"conventional-changelog-core": "^1.6.0", | ||
"git-dummy-commit": "^1.1.1", | ||
@@ -32,0 +32,0 @@ "istanbul": "^0.4.1", |
'use strict'; | ||
var child = require('child_process'); | ||
var execSync = require('child_process').execSync; | ||
var conventionalChangelogCore = require('conventional-changelog-core'); | ||
@@ -9,5 +9,7 @@ var preset = require('../'); | ||
var through = require('through2'); | ||
var betterThanBefore = require('better-than-before')(); | ||
var preparing = betterThanBefore.preparing; | ||
describe('angular preset', function() { | ||
before(function(done) { | ||
betterThanBefore.setups([ | ||
function() { | ||
shell.config.silent = true; | ||
@@ -21,14 +23,37 @@ shell.rm('-rf', 'tmp'); | ||
gitDummyCommit('chore: first commit'); | ||
// fix this once https://github.com/arturadib/shelljs/issues/175 is solved | ||
child.exec('git commit -m"feat: amazing new module\n\nBREAKING CHANGE: Not backward compatible." --allow-empty', function() { | ||
gitDummyCommit(['fix(compile): avoid a bug', 'BREAKING CHANGE: The Change is huge.']); | ||
gitDummyCommit(['perf(ngOptions): make it faster', ' closes #1, #2']); | ||
gitDummyCommit('revert(ngOptions): bad commit'); | ||
gitDummyCommit('fix(*): oops'); | ||
gitDummyCommit(['feat: amazing new module', 'BREAKING CHANGE: Not backward compatible.']); | ||
gitDummyCommit(['fix(compile): avoid a bug', 'BREAKING CHANGE: The Change is huge.']); | ||
gitDummyCommit(['perf(ngOptions): make it faster', ' closes #1, #2']); | ||
gitDummyCommit('revert(ngOptions): bad commit'); | ||
gitDummyCommit('fix(*): oops'); | ||
}, | ||
function() { | ||
gitDummyCommit(['feat(awesome): addresses the issue brought up in #133']); | ||
}, | ||
function() { | ||
gitDummyCommit(['feat(awesome): fix #88']); | ||
}, | ||
function() { | ||
gitDummyCommit(['feat(awesome): issue brought up by @bcoe! on Friday']); | ||
}, | ||
function() { | ||
gitDummyCommit(['docs(readme): make it clear', 'BREAKING CHANGE: The Change is huge.']); | ||
gitDummyCommit(['style(whitespace): make it easier to read', 'BREAKING CHANGE: The Change is huge.']); | ||
gitDummyCommit(['refactor(code): change a lot of code', 'BREAKING CHANGE: The Change is huge.']); | ||
gitDummyCommit(['test(*): more tests', 'BREAKING CHANGE: The Change is huge.']); | ||
gitDummyCommit(['chore(deps): bump', 'BREAKING CHANGE: The Change is huge.']); | ||
}, | ||
function() { | ||
gitDummyCommit(['feat(deps): bump', 'BREAKING CHANGES: Also works :)']); | ||
}, | ||
function() { | ||
shell.exec('git tag v1.0.0'); | ||
gitDummyCommit('feat: some more features'); | ||
} | ||
]); | ||
done(); | ||
}); | ||
}); | ||
describe('angular preset', function() { | ||
it('should work if there is no semver tag', function(done) { | ||
preparing(1); | ||
it('should work if there is no semver tag', function(done) { | ||
conventionalChangelogCore({ | ||
@@ -44,7 +69,7 @@ config: preset | ||
expect(chunk).to.include('amazing new module'); | ||
expect(chunk).to.include('avoid a bug'); | ||
expect(chunk).to.include('**compile:** avoid a bug'); | ||
expect(chunk).to.include('make it faster'); | ||
expect(chunk).to.include(', closes [#1](https://github.com/conventional-changelog/conventional-changelog-angular/issues/1) [#2](https://github.com/conventional-changelog/conventional-changelog-angular/issues/2)'); | ||
expect(chunk).to.include('Not backward compatible.'); | ||
expect(chunk).to.include('compile: The Change is huge.'); | ||
expect(chunk).to.include('**compile:** The Change is huge.'); | ||
expect(chunk).to.include('Features'); | ||
@@ -70,3 +95,3 @@ expect(chunk).to.include('Bug Fixes'); | ||
it('should replace #[0-9]+ with GitHub issue URL', function(done) { | ||
gitDummyCommit(['feat(awesome): addresses the issue brought up in #133']); | ||
preparing(2); | ||
@@ -87,3 +112,3 @@ conventionalChangelogCore({ | ||
it('should remove the issues that already appear in the subject', function(done) { | ||
gitDummyCommit(['feat(awesome): fix #88']); | ||
preparing(3); | ||
@@ -105,3 +130,3 @@ conventionalChangelogCore({ | ||
it('should replace @username with GitHub user URL', function(done) { | ||
gitDummyCommit(['feat(awesome): issue brought up by @bcoe! on Friday']); | ||
preparing(4); | ||
@@ -122,7 +147,3 @@ conventionalChangelogCore({ | ||
it('should not discard commit if there is BREAKING CHANGE', function(done) { | ||
gitDummyCommit(['docs(readme): make it clear', 'BREAKING CHANGE: The Change is huge.']); | ||
gitDummyCommit(['style(whitespace): make it easier to read', 'BREAKING CHANGE: The Change is huge.']); | ||
gitDummyCommit(['refactor(code): change a lot of code', 'BREAKING CHANGE: The Change is huge.']); | ||
gitDummyCommit(['test(*): more tests', 'BREAKING CHANGE: The Change is huge.']); | ||
gitDummyCommit(['chore(deps): bump', 'BREAKING CHANGE: The Change is huge.']); | ||
preparing(5); | ||
@@ -149,3 +170,3 @@ conventionalChangelogCore({ | ||
it('should BREAKING CHANGES the same as BREAKING CHANGE', function(done) { | ||
gitDummyCommit(['feat(deps): bump', 'BREAKING CHANGES: Also works :)']); | ||
preparing(6); | ||
@@ -168,7 +189,5 @@ conventionalChangelogCore({ | ||
it('should work if there is a semver tag', function(done) { | ||
preparing(7); | ||
var i = 0; | ||
shell.exec('git tag v1.0.0'); | ||
gitDummyCommit('feat: some more features'); | ||
conventionalChangelogCore({ | ||
@@ -196,2 +215,3 @@ config: preset, | ||
it('should work with unknown host', function(done) { | ||
preparing(7); | ||
var i = 0; | ||
@@ -198,0 +218,0 @@ |
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
21940
320
2