-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.js
40 lines (33 loc) · 955 Bytes
/
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
40
const AQ = require("./gofish/aquarium");
const Connection = require("./connect.js");
const fs = require('fs');
const util = require("./util");
const ejs = require("ejs");
class Tester {
constructor() {
this.results = {};
}
async run() {
let c = new Connection("staging");
await c.connect();
let info = util.info();
if ( info.type == "OperationType" ) {
this.result = await AQ.get("/test/run/" + info.id);
this.result = JSON.parse(this.result.data);
} else {
throw "Testing libraries directly is not supported";
}
}
report() {
let path = "/home/crush/templates/test.md"
ejs.renderFile(
path,
{ results: this.result },
{ filename: path },
function(err, str) {
fs.writeFileSync("results.md", str);
}
);
}
}
module.exports = Tester;