forked from jivesoftware/jive-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
49 lines (43 loc) · 1.59 KB
/
Gruntfile.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
40
41
42
43
44
45
46
47
48
module.exports = function(grunt) {
var jive = require('./jive-sdk-service/api');
var mockery = require('mockery');
grunt.initConfig({
runJiveTests: {
options: {
testcases: 'test/unit',
context: function() {
return {
jive: jive,
testUtils: require('./test/util/testUtils'),
mockery : mockery
}
},
eventHandlers: {
onTestPass: function () {
mockery.resetCache();
},
onTestFail: function () {
mockery.resetCache();
},
setupSuite: function () {
var logger = jive.logger;
logger.setLevel('FATAL');
jive['context']['config']['logLevel'] = 'FATAL';
console.log('registering');
mockery.registerMock('jive-sdk', jive);
mockery.enable();
mockery.warnOnReplace(false);
mockery.warnOnUnregistered(false);
},
teardownSuite: function () {
mockery.deregisterAll();
mockery.disable();
}
}
}
}
});
grunt.loadNpmTasks('jive-testing-framework');
grunt.registerTask('test', ['runJiveTests']);
grunt.registerTask('default', ['test']);
};