forked from nightscout/cgm-remote-monitor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplugins.test.js
39 lines (26 loc) · 954 Bytes
/
plugins.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
'use strict';
var should = require('should');
describe('Plugins', function ( ) {
it('should find client plugins, but not server only plugins', function (done) {
var plugins = require('../lib/plugins/')({
settings: { }
, language: require('../lib/language')()
}).registerClientDefaults();
plugins('bgnow').name.should.equal('bgnow');
plugins('rawbg').name.should.equal('rawbg');
//server only plugin
should.not.exist(plugins('treatmentnotify'));
done( );
});
it('should find sever plugins, but not client only plugins', function (done) {
var plugins = require('../lib/plugins/')({
settings: { }
, language: require('../lib/language')()
}).registerServerDefaults();
plugins('rawbg').name.should.equal('rawbg');
plugins('treatmentnotify').name.should.equal('treatmentnotify');
//client only plugin
should.not.exist(plugins('cannulaage'));
done( );
});
});