diff --git a/.travis.yml b/.travis.yml index e1e7f5e2..1797b138 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: node_js os: - linux node_js: - - "4" - "6" + - "8" - "node" after_script: npm run coverage diff --git a/package.json b/package.json index 933ca217..e574e428 100644 --- a/package.json +++ b/package.json @@ -26,19 +26,22 @@ "author": "Ben Coe ", "license": "ISC", "devDependencies": { - "chai": "^3.5.0", - "coveralls": "^2.11.12", - "mocha": "^3.0.1", - "nyc": "^11.4.1", - "standard": "^10.0.2", - "standard-version": "^4.3.0" + "chai": "^4.2.0", + "coveralls": "^3.0.2", + "mocha": "^5.2.0", + "nyc": "^13.0.1", + "standard": "^12.0.1", + "standard-version": "^4.4.0" }, "dependencies": { - "camelcase": "^4.1.0", - "decamelize": "^2.0.0" + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" }, "files": [ "lib", "index.js" - ] + ], + "engine": { + "node": ">=6" + } } diff --git a/test/yargs-parser.js b/test/yargs-parser.js index e483536e..7f220a17 100644 --- a/test/yargs-parser.js +++ b/test/yargs-parser.js @@ -146,7 +146,7 @@ describe('yargs-parser', function () { '--other', '-99', '-220' ], { array: 'bounds', - narg: {'other': 2} + narg: { 'other': 2 } }) argv._.should.deep.equal([-33, -177, 33]) @@ -1419,12 +1419,12 @@ describe('yargs-parser', function () { describe('array', function () { it('should group values into an array if the same option is specified multiple times (duplicate-arguments-array=true)', function () { - var parse = parser(['-v', 'a', '-v', 'b', '-v', 'c'], {configuration: {'duplicate-arguments-array': true}}) + var parse = parser(['-v', 'a', '-v', 'b', '-v', 'c'], { configuration: { 'duplicate-arguments-array': true } }) parse.should.have.property('v').and.deep.equal(['a', 'b', 'c']) parse.should.have.property('_').with.length(0) }) it('should keep only the last value if the same option is specified multiple times (duplicate-arguments-false)', function () { - var parse = parser(['-v', 'a', '-v', 'b', '-v', 'c'], {configuration: {'duplicate-arguments-array': false}}) + var parse = parser(['-v', 'a', '-v', 'b', '-v', 'c'], { configuration: { 'duplicate-arguments-array': false } }) parse.should.have.property('v').and.equal('c') parse.should.have.property('_').with.length(0) }) @@ -1503,8 +1503,8 @@ describe('yargs-parser', function () { var result = parser(['-a=hello', 'world', '-b', '33', '22', '--foo', 'red', 'green', '--bar=cat', 'dog'], { - array: ['a', 'b', 'foo', 'bar'] - }) + array: ['a', 'b', 'foo', 'bar'] + }) Array.isArray(result.a).should.equal(true) result.a.should.include('hello') @@ -2166,7 +2166,7 @@ describe('yargs-parser', function () { } }) - parsed['x'].should.deep.equal({foo: ['a', 'b']}) + parsed['x'].should.deep.equal({ foo: ['a', 'b'] }) }) }) @@ -2400,13 +2400,13 @@ describe('yargs-parser', function () { number: ['d'], count: ['e'], normalize: ['f'], - narg: {g: 2}, + narg: { g: 2 }, coerce: { h: function (arg) { return arg } }, - configuration: {'set-placeholder-key': true} + configuration: { 'set-placeholder-key': true } }) parsed.should.have.property('a') expect(parsed.a).to.be.equal(undefined) @@ -2427,8 +2427,8 @@ describe('yargs-parser', function () { it('should not set placeholder for key with a default value', function () { var parsed = parser([], { string: ['a'], - default: {a: 'hello'}, - configuration: {'set-placeholder-key': true} + default: { a: 'hello' }, + configuration: { 'set-placeholder-key': true } }) parsed.a.should.equal('hello') }) @@ -2639,7 +2639,7 @@ describe('yargs-parser', function () { var argv = parser([ '--foo', 'bar' ], { array: ['a'], normalize: ['a'], - configObjects: [{'a': ['bin/../a.txt', 'bin/../b.txt']}] + configObjects: [{ 'a': ['bin/../a.txt', 'bin/../b.txt'] }] }) argv.a.should.deep.equal(['a.txt', 'b.txt']) })