Skip to content

Commit 06dfd3a

Browse files
committed
use blueprint in test
1 parent e030dde commit 06dfd3a

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

test/client.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,20 @@ describe('client module', function() {
44

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

9-
should(pipedrive.Deals).be.an.Object();
10-
should(pipedrive.Persons).be.an.Object();
11-
should(pipedrive.Organizations).be.an.Object();
12-
should(pipedrive.Activities).be.an.Object();
13-
should(pipedrive.Products).be.an.Object();
14-
should(pipedrive.Files).be.an.Object();
15-
should(pipedrive.Users).be.an.Object();
10+
// iterate through all top level objects which should be exposed, e.g. pipedrive.Deals, ...
11+
blueprint.apiObjects.forEach(function(obj) {
12+
should(pipedrive[obj.substr(0,1).toUpperCase() + obj.substr(1)]).be.an.Object();
13+
});
14+
});
15+
16+
it('should expose .on() listener in strict mode', function() {
17+
var Pipedrive = require('./..'),
18+
pipedrive = new Pipedrive.Client('apitoken', { strictMode: true });
19+
20+
should(pipedrive.on).be.a.Function();
1621
});
1722

1823
});

0 commit comments

Comments
 (0)