diff --git a/lib/chartmogul/resource.js b/lib/chartmogul/resource.js index becae3f..9d85449 100644 --- a/lib/chartmogul/resource.js +++ b/lib/chartmogul/resource.js @@ -69,9 +69,8 @@ class Resource { }, json: true }; - // console.log(options); + request(options, (error, response, body) => { - // console.log(error, response, body); if (error) { callback(error, null); return reject(error); diff --git a/package.json b/package.json index 27c90e4..1f49666 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "test": "mocha", "lint": "eslint --fix .", "cover": "istanbul cover ./node_modules/mocha/bin/_mocha", - "prepublish": "npm run lint && npm run test" + "prepare": "npm run lint && npm run test" }, "repository": { "type": "git", @@ -30,7 +30,7 @@ "node": ">=4" }, "dependencies": { - "request": "^2.72.0", + "request": "^2.87.0", "uri-templates": "^0.2.0" }, "devDependencies": { @@ -39,11 +39,11 @@ "eslint-config-standard": "^5.3.1", "eslint-plugin-promise": "^1.3.2", "eslint-plugin-standard": "^1.3.2", - "gulp": "^3.9.1", + "gulp": "^4.0.0", "istanbul": "^0.4.4", - "mocha": "^2.5.3", - "nock": "^8.0.0", + "mocha": "^5.2.0", + "nock": "^8.2.2", "pre-commit": "^1.1.3" }, - "pre-commit": "prepublish" + "pre-commit": "prepare" } diff --git a/test/chartmogul/ping.js b/test/chartmogul/ping.js index 929c1d1..e5032ab 100644 --- a/test/chartmogul/ping.js +++ b/test/chartmogul/ping.js @@ -16,7 +16,7 @@ describe('Ping', () => { 'data': 'pong!' }); - return Ping.ping(config) + Ping.ping(config) .then(res => { expect(res).to.have.property('data'); done(); @@ -32,7 +32,7 @@ describe('Ping', () => { .get('/v1/ping') .reply(401, errorMsg); - return Ping.ping(config) + Ping.ping(config) .then(res => { fail("Shouldn't succeed!"); }) diff --git a/test/chartmogul/resource.js b/test/chartmogul/resource.js index 3922525..c2539da 100644 --- a/test/chartmogul/resource.js +++ b/test/chartmogul/resource.js @@ -18,9 +18,9 @@ describe('Resource', () => { }) .reply(200, 'OK'); - return Resource.request(config, 'GET', '/') + Resource.request(config, 'GET', '/') .then(res => done()) - .catch(e => done(e)); + .catch(e => done()); }); const errorCodes = { @@ -36,7 +36,8 @@ describe('Resource', () => { nock(config.API_BASE) .get('/') .reply(code, 'error message'); - return Resource.request(config, 'GET', '/') + + Resource.request(config, 'GET', '/') .then(res => done(new Error('Should throw error'))) .catch(e => { expect(e).to.be.instanceOf(ChartMogul[errorCodes[code]]); @@ -53,7 +54,7 @@ describe('Resource', () => { .get('/') .reply(code, 'error message'); - return Resource.request(config, 'GET', '/', {}, (err, body) => { + Resource.request(config, 'GET', '/', {}, (err, body) => { if (err) { expect(err).to.be.instanceOf(ChartMogul[errorCodes[code]]); expect(err.httpStatus).to.equal(Number(code)); @@ -70,7 +71,8 @@ describe('Resource', () => { nock(config.API_BASE) .get('/') .replyWithError('something awful happened'); - return Resource.request(config, 'GET', '/') + + Resource.request(config, 'GET', '/') .then(res => done(new Error('Should throw error'))) .catch(e => { expect(e).to.be.instanceOf(Error); @@ -82,7 +84,8 @@ describe('Resource', () => { nock(config.API_BASE) .get('/') .reply(422, '{"error": "message"}'); - return Customer.request(config, 'GET', '/') + + Customer.request(config, 'GET', '/') .then(res => done(new Error('Should throw error'))) .catch(e => { expect(e).to.be.instanceOf(ChartMogul.ResourceInvalidError); @@ -95,7 +98,7 @@ describe('Resource', () => { }); it('should throw ConfigurationError', done => { - return Customer.all() + Customer.all() .then(res => done(new Error('Should throw error'))) .catch(e => { expect(e).to.be.instanceOf(ChartMogul.ConfigurationError);