UNPKG

1.05 kBJavaScriptView Raw
1var Mixpanel = require('../lib/mixpanel-node');
2
3exports.config = {
4 setUp: function(cb) {
5 this.mixpanel = Mixpanel.init('asjdf');
6 cb();
7 },
8
9 "is set to correct defaults": function(test) {
10 test.deepEqual(this.mixpanel.config, {
11 test: false,
12 debug: false,
13 verbose: false,
14 host: 'api.mixpanel.com',
15 protocol: 'https',
16 path: ''
17 }, "default config is incorrect");
18 test.done();
19 },
20
21 "is modified by set_config": function(test) {
22 test.equal(this.mixpanel.config.test, false, "default config has incorrect value for test");
23
24 this.mixpanel.set_config({ test: true });
25
26 test.equal(this.mixpanel.config.test, true, "set_config failed to modify the config");
27
28 test.done();
29 },
30
31 "can be set during init": function(test) {
32 var mp = Mixpanel.init('token', { test: true });
33
34 test.equal(mp.config.test, true, "init() didn't set the config correctly");
35 test.done();
36 }
37};