Skip to content

Commit d584f51

Browse files
authored
Merge pull request #46 from pipedrive/IND-524
IND-524 Fixed error passing
2 parents 7c9582f + abda81b commit d584f51

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,9 @@ To read more about ad hoc data change event listeners, check out [examples/live-
248248

249249
The Pipedrive REST API documentation can be found at https://developers.pipedrive.com/v1
250250

251+
#Testing
252+
To run unit tests, execute `npm run tests`
253+
251254
# Licence
252255

253256
This Pipedrive API client is distributed under the MIT licence.

lib/rest.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@
109109
meta.responseHeaders = meta && meta.responseHeaders || {};
110110

111111
this.response = {
112+
statusCode: meta.statusCode,
112113
rawEncoded: body,
113114
req: this.options,
114115
headers: meta.responseHeaders,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"url": "http://github.com/pipedrive/client-nodejs.git"
2323
},
2424
"scripts": {
25-
"test": "./node_modules/mocha/bin/mocha ./test"
25+
"test": "./node_modules/mocha/bin/mocha ./test/unit"
2626
},
2727
"dependencies": {
2828
"async": "~0.9.0",

test/client.js renamed to test/unit/client.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ var should = require('should');
33
describe('client module', function() {
44

55
it('should expose some of the main object types', function() {
6-
var Pipedrive = require('./..'),
6+
var Pipedrive = require('./../..'),
77
pipedrive = new Pipedrive.Client('apitoken'),
8-
blueprint = require('./../lib/blueprint');
8+
blueprint = require('./../../lib/blueprint');
99

1010
// iterate through all top level objects which should be exposed, e.g. pipedrive.Deals, ...
1111
blueprint.apiObjects.forEach(function(obj) {
@@ -14,10 +14,9 @@ describe('client module', function() {
1414
});
1515

1616
it('should expose .on() listener in strict mode', function() {
17-
var Pipedrive = require('./..'),
17+
var Pipedrive = require('./../..'),
1818
pipedrive = new Pipedrive.Client('apitoken', { strictMode: true });
1919

2020
should(pipedrive.on).be.a.Function();
2121
});
22-
2322
});

test/index.js renamed to test/unit/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ var should = require('should');
33
describe('main module', function() {
44

55
it('should be requireable without errors', function() {
6-
var Pipedrive = require('./..');
6+
var Pipedrive = require('./../..');
77
});
88

99
it('should expose top-level functionality', function() {
10-
var Pipedrive = require('./..');
10+
var Pipedrive = require('./../..');
1111

1212
should(Pipedrive.Client).be.a.Function();
1313
should(Pipedrive.authenticate).be.a.Function();

0 commit comments

Comments
 (0)