forked from CleverCloud/clever-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
33 lines (30 loc) · 858 Bytes
/
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
module.exports = function(grunt) {
var fs = require('fs');
grunt.initConfig({
mochaTest: {
test: {
src: ["spec/*.spec.js"]
}
},
http: {
scalers: {
options: {
url: "https://api.clever-cloud.com/v2/products/instances",
gzip: true,
agent: new (require("https").Agent)({ keepAlive: true }),
callback: function(error, response, body){
if(error){
grunt.log.error(error);
} else{
var content = "module.exports=" + JSON.stringify(JSON.parse(body));
fs.writeFileSync("./spec/application.instance-types.js", content);
}
}
}
}
}
});
grunt.loadNpmTasks('grunt-http');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.registerTask('test', ['http', 'mochaTest']);
};