Skip to content

Commit 8dd8d06

Browse files
author
Benjamin E. Coe
authored
Merge branch 'master' into release-v8.0.1
2 parents a316e37 + 267d78d commit 8dd8d06

File tree

3 files changed

+92
-82
lines changed

3 files changed

+92
-82
lines changed

package.json

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"description": "replacement for `npm version` with automatic CHANGELOG generation",
55
"bin": "bin/cli.js",
66
"scripts": {
7+
"fix": "eslint . --fix",
78
"posttest": "eslint .",
89
"test": "nyc mocha --timeout=30000 test.js",
910
"release": "bin/cli.js"
@@ -34,35 +35,35 @@
3435
},
3536
"homepage": "https://github.com/conventional-changelog/standard-version#readme",
3637
"dependencies": {
37-
"chalk": "2.4.2",
38+
"chalk": "^2.4.2",
3839
"conventional-changelog": "3.1.21",
3940
"conventional-changelog-config-spec": "2.1.0",
4041
"conventional-changelog-conventionalcommits": "4.3.0",
4142
"conventional-recommended-bump": "6.0.9",
42-
"detect-indent": "6.0.0",
43-
"detect-newline": "3.1.0",
44-
"dotgitignore": "2.1.0",
45-
"figures": "3.1.0",
46-
"find-up": "4.1.0",
47-
"fs-access": "1.0.1",
48-
"git-semver-tags": "4.0.0",
49-
"semver": "7.1.1",
50-
"stringify-package": "1.0.1",
51-
"yargs": "15.3.1"
43+
"detect-indent": "^6.0.0",
44+
"detect-newline": "^3.1.0",
45+
"dotgitignore": "^2.1.0",
46+
"figures": "^3.1.0",
47+
"find-up": "^4.1.0",
48+
"fs-access": "^1.0.1",
49+
"git-semver-tags": "^4.0.0",
50+
"semver": "^7.1.1",
51+
"stringify-package": "^1.0.1",
52+
"yargs": "^15.3.1"
5253
},
5354
"devDependencies": {
54-
"chai": "4.2.0",
55-
"coveralls": "3.1.0",
56-
"eslint": "6.8.0",
57-
"eslint-config-standard": "14.1.1",
58-
"eslint-plugin-import": "2.20.0",
59-
"eslint-plugin-node": "10.0.0",
60-
"eslint-plugin-promise": "4.2.1",
61-
"eslint-plugin-standard": "4.0.1",
62-
"mocha": "7.2.0",
63-
"mock-git": "2.0.0",
64-
"mockery": "2.1.0",
65-
"nyc": "14.1.1",
66-
"shelljs": "0.8.4"
55+
"chai": "^4.2.0",
56+
"coveralls": "^3.1.0",
57+
"eslint": "^6.8.0",
58+
"eslint-config-standard": "^14.1.1",
59+
"eslint-plugin-import": "^2.20.0",
60+
"eslint-plugin-node": "^10.0.0",
61+
"eslint-plugin-promise": "^4.2.1",
62+
"eslint-plugin-standard": "^4.0.1",
63+
"mocha": "^7.2.0",
64+
"mock-git": "^2.0.0",
65+
"mockery": "^2.1.0",
66+
"nyc": "^14.1.1",
67+
"shelljs": "^0.8.4"
6768
}
6869
}

renovate.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
{
22
"extends": [
33
"config:base"
4-
]
4+
],
5+
"pinVersions": false,
6+
"rebaseStalePrs": true,
7+
"gitAuthor": null,
8+
"ignoreDeps": ["decamelize"]
59
}

test.js

Lines changed: 62 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ const formatCommitMessage = require('./lib/format-commit-message')
1313
const cli = require('./command')
1414
const standardVersion = require('./index')
1515

16+
const isWindows = process.platform === 'win32'
17+
1618
require('chai').should()
1719

1820
const cliPath = path.resolve(__dirname, './bin/cli.js')
@@ -248,74 +250,77 @@ describe('cli', function () {
248250
})
249251
})
250252

251-
describe('with mocked git', function () {
252-
it('--sign signs the commit and tag', function () {
253-
// mock git with file that writes args to gitcapture.log
254-
return mockGit('require("fs").appendFileSync("gitcapture.log", JSON.stringify(process.argv.splice(2)) + "\\n")')
255-
.then(function (unmock) {
256-
execCli('--sign').code.should.equal(0)
257-
258-
const captured = shell.cat('gitcapture.log').stdout.split('\n').map(function (line) {
259-
return line ? JSON.parse(line) : line
253+
// TODO: investigate why mock-git does not play well with execFile on Windows.
254+
if (!isWindows) {
255+
describe('with mocked git', function () {
256+
it('--sign signs the commit and tag', function () {
257+
// mock git with file that writes args to gitcapture.log
258+
return mockGit('require("fs").appendFileSync("gitcapture.log", JSON.stringify(process.argv.splice(2)) + "\\n")')
259+
.then(function (unmock) {
260+
execCli('--sign').code.should.equal(0)
261+
262+
const captured = shell.cat('gitcapture.log').stdout.split('\n').map(function (line) {
263+
return line ? JSON.parse(line) : line
264+
})
265+
/* eslint-disable no-useless-escape */
266+
captured[captured.length - 4].should.deep.equal(['commit', '-S', 'CHANGELOG.md', 'package.json', '-m', '\"chore(release): 1.0.1\"'])
267+
captured[captured.length - 3].should.deep.equal(['tag', '-s', 'v1.0.1', '-m', '\"chore(release): 1.0.1\"'])
268+
/* eslint-enable no-useless-escape */
269+
unmock()
260270
})
261-
/* eslint-disable no-useless-escape */
262-
captured[captured.length - 4].should.deep.equal(['commit', '-S', 'CHANGELOG.md', 'package.json', '-m', '\"chore(release): 1.0.1\"'])
263-
captured[captured.length - 3].should.deep.equal(['tag', '-s', 'v1.0.1', '-m', '\"chore(release): 1.0.1\"'])
264-
/* eslint-enable no-useless-escape */
265-
unmock()
266-
})
267-
})
271+
})
268272

269-
it('exits with error code if git commit fails', function () {
270-
// mock git by throwing on attempt to commit
271-
return mockGit('console.error("commit yourself"); process.exit(128);', 'commit')
272-
.then(function (unmock) {
273-
const result = execCli()
274-
result.code.should.equal(1)
275-
result.stderr.should.match(/commit yourself/)
273+
it('exits with error code if git commit fails', function () {
274+
// mock git by throwing on attempt to commit
275+
return mockGit('console.error("commit yourself"); process.exit(128);', 'commit')
276+
.then(function (unmock) {
277+
const result = execCli()
278+
result.code.should.equal(1)
279+
result.stderr.should.match(/commit yourself/)
276280

277-
unmock()
278-
})
279-
})
281+
unmock()
282+
})
283+
})
280284

281-
it('exits with error code if git add fails', function () {
282-
// mock git by throwing on attempt to add
283-
return mockGit('console.error("addition is hard"); process.exit(128);', 'add')
284-
.then(function (unmock) {
285-
const result = execCli()
286-
result.code.should.equal(1)
287-
result.stderr.should.match(/addition is hard/)
285+
it('exits with error code if git add fails', function () {
286+
// mock git by throwing on attempt to add
287+
return mockGit('console.error("addition is hard"); process.exit(128);', 'add')
288+
.then(function (unmock) {
289+
const result = execCli()
290+
result.code.should.equal(1)
291+
result.stderr.should.match(/addition is hard/)
288292

289-
unmock()
290-
})
291-
})
293+
unmock()
294+
})
295+
})
292296

293-
it('exits with error code if git tag fails', function () {
294-
// mock git by throwing on attempt to commit
295-
return mockGit('console.error("tag, you\'re it"); process.exit(128);', 'tag')
296-
.then(function (unmock) {
297-
const result = execCli()
298-
result.code.should.equal(1)
299-
result.stderr.should.match(/tag, you're it/)
297+
it('exits with error code if git tag fails', function () {
298+
// mock git by throwing on attempt to commit
299+
return mockGit('console.error("tag, you\'re it"); process.exit(128);', 'tag')
300+
.then(function (unmock) {
301+
const result = execCli()
302+
result.code.should.equal(1)
303+
result.stderr.should.match(/tag, you're it/)
300304

301-
unmock()
302-
})
303-
})
305+
unmock()
306+
})
307+
})
304308

305-
it('doesn\'t fail fast on stderr output from git', function () {
306-
// mock git by throwing on attempt to commit
307-
return mockGit('console.error("haha, kidding, this is just a warning"); process.exit(0);', 'add')
308-
.then(function (unmock) {
309-
writePackageJson('1.0.0')
309+
it('doesn\'t fail fast on stderr output from git', function () {
310+
// mock git by throwing on attempt to commit
311+
return mockGit('console.error("haha, kidding, this is just a warning"); process.exit(0);', 'add')
312+
.then(function (unmock) {
313+
writePackageJson('1.0.0')
310314

311-
const result = execCli()
312-
result.code.should.equal(1)
313-
result.stderr.should.match(/haha, kidding, this is just a warning/)
315+
const result = execCli()
316+
result.code.should.equal(1)
317+
result.stderr.should.match(/haha, kidding, this is just a warning/)
314318

315-
unmock()
316-
})
319+
unmock()
320+
})
321+
})
317322
})
318-
})
323+
}
319324

320325
describe('lifecycle scripts', () => {
321326
describe('prerelease hook', function () {

0 commit comments

Comments
 (0)