diff --git a/.travis.yml b/.travis.yml index a32dc95..eb99d2c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,9 @@ sudo: false language: "node_js" node_js: - - "4.2" - - "5.0" + - "4" + - "5" + - "6" script: - npm install istanbul - istanbul cover ./node_modules/.bin/_mocha --report lcovonly diff --git a/appveyor.yml b/appveyor.yml index 73f0803..ebf8720 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,6 +3,7 @@ environment: matrix: - nodejs_version: "4" - nodejs_version: "5" + - nodejs_version: "6" # Install scripts. (runs after repo cloning) install: diff --git a/lib/changelog.js b/lib/changelog.js index 145aaea..84f568d 100755 --- a/lib/changelog.js +++ b/lib/changelog.js @@ -6,7 +6,7 @@ */ 'use strict' -var qfs = require('q-io/fs') +var qfs = require('m-io/fs') var path = require('path') var qcp = require('../lib/q-child-process.js') diff --git a/lib/git.js b/lib/git.js index 5ce2ccc..7d078cb 100644 --- a/lib/git.js +++ b/lib/git.js @@ -7,7 +7,7 @@ 'use strict' var cpp = require('../lib/q-child-process') -var qfs = require('q-io/fs') +var qfs = require('m-io/fs') var path = require('path') var moment = require('moment') var debug = require('debug')('thoughtful-release:git') diff --git a/lib/npm.js b/lib/npm.js index 6dcb139..99fb684 100644 --- a/lib/npm.js +++ b/lib/npm.js @@ -8,7 +8,7 @@ var path = require('path') var semver = require('semver') -var qfs = require('q-io/fs') +var qfs = require('m-io/fs') var Q = require('q') var _ = { defaultsDeep: require('lodash.defaultsdeep') diff --git a/package.json b/package.json index f9e216a..5b71c90 100644 --- a/package.json +++ b/package.json @@ -43,9 +43,10 @@ "lodash.isplainobject": "^3", "lodash.isstring": "^3.0.1", "lodash.toarray": "^3.0.2", + "m-io": "*", + "mkdirp": "^0.5.1", "moment": "^2.11.1", "q": "^1.4.1", - "q-io": "^1.13.2", "semver": "^5.1.0" }, "devDependencies": { @@ -68,7 +69,7 @@ }, "config": { "ghooks": { - "pre-commit": "thoughtful precommit && standard && thought run -a" + "pre-commit": "thoughtful precommit && standard" } }, "keywords": [] diff --git a/test/changelog-spec.js b/test/changelog-spec.js index 4412a79..fc4b168 100644 --- a/test/changelog-spec.js +++ b/test/changelog-spec.js @@ -19,9 +19,9 @@ var chaiAsPromised = require('chai-as-promised') chai.use(chaiAsPromised) var expect = chai.expect var changelog = require('../lib/changelog.js') -var qfs = require('q-io/fs') +var qfs = require('m-io/fs') var path = require('path') -require('trace') +require('./trace') function fixture (filename) { return require('fs').readFileSync(path.join('test', 'fixtures', filename), {encoding: 'utf-8'}) diff --git a/test/git-spec.js b/test/git-spec.js index 496bf25..3272e4e 100644 --- a/test/git-spec.js +++ b/test/git-spec.js @@ -18,9 +18,10 @@ var chaiAsPromised = require('chai-as-promised') chai.use(chaiAsPromised) var expect = chai.expect var git = require('../lib/git.js') -var qfs = require('q-io/fs') +var qfs = require('m-io/fs') var Q = require('q') var path = require('path') +require('./trace') describe('git-library:', () => { afterEach(() => { diff --git a/test/index-spec.js b/test/index-spec.js index 3858ea8..025b08f 100644 --- a/test/index-spec.js +++ b/test/index-spec.js @@ -16,14 +16,14 @@ 'use strict' -require('trace') +require('./trace') var chai = require('chai') var chaiAsPromised = require('chai-as-promised') chai.use(chaiAsPromised) var expect = chai.expect var qcp = require('../lib/q-child-process') -var qfs = require('q-io/fs') +var qfs = require('m-io/fs') var path = require('path') var Q = require('q') var _ = { @@ -123,9 +123,14 @@ describe('main-module:', () => { this.timeout(5000) // Update changelog and bump version var changelogContents = thoughtful.updateChangelog({release: 'minor'}) - .then(() => qcp.execFile('npm', ['version', 'minor'], {cwd: workDir()})) - // On Windows, we need to call the '.cmd' file - .catch(() => qcp.execFile('npm.cmd', ['version', 'minor'], {cwd: workDir()})) + .then(() => { + if (process.platform.match(/^win/i)) { + // On Windows, we need to call the '.cmd' file + return qcp.execFile('npm.cmd', ['version', 'minor'], {cwd: workDir()}) + } else { + return qcp.execFile('npm', ['version', 'minor'], {cwd: workDir()}) + } + }) // Add another file .then(() => qfs.write(workDir('index.js'), "'use strict'")) .then(() => qcp.execFile('git', ['add', 'index.js'], {cwd: workDir()})) diff --git a/test/npm-spec.js b/test/npm-spec.js index de8146b..0e8f0a2 100644 --- a/test/npm-spec.js +++ b/test/npm-spec.js @@ -17,6 +17,7 @@ var chaiAsPromised = require('chai-as-promised') chai.use(chaiAsPromised) var expect = chai.expect var npm = require('../lib/npm.js') +require('./trace') describe('The npm-helper lib:', () => { describe('The version method', () => { diff --git a/test/q-child-process-spec.js b/test/q-child-process-spec.js index cd3ef14..5b4e91c 100644 --- a/test/q-child-process-spec.js +++ b/test/q-child-process-spec.js @@ -19,6 +19,7 @@ chai.use(chaiAsPromised) var expect = chai.expect var path = require('path') var qcp = require('../lib/q-child-process') +require('./trace') describe('q-child-process-library:', () => { describe('the spawn-method', () => { diff --git a/test/test.js b/test/test.js new file mode 100644 index 0000000..e69de29 diff --git a/test/trace.js b/test/trace.js new file mode 100644 index 0000000..b728f53 --- /dev/null +++ b/test/trace.js @@ -0,0 +1,9 @@ +/** + * A shortcut for loding `trace` only with compatible versions (i.e. node 6) + */ + +'use strict' + +if (process.version.match(/v6/)) { + require('trace') +}