-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathtestrunner.js
63 lines (54 loc) · 1.67 KB
/
testrunner.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
var mso_pdf = require('./lib');
var uuid = require('node-uuid');
var okay = 0, errors = 0;
mso_pdf(null, function (error, office) {
if (error) {
console.log("Failed to init");
return;
}
for (var i = 0; i< 45; i++) {
office.word({
input: "testcases\\test.docx",
output: "output.doc." + uuid.v4() + ".pdf"
}, function (error, pdf) {
if (error) {
console.log("Word: Failed to convert", error);
errors++;
}
else {
console.log("Converted to: " + pdf);
okay++;
}
});
office.excel({
input: "testcases\\test.xlsx",
output: "output.xls." + uuid.v4() + ".pdf"
}, function (error, pdf) {
if (error) {
console.log("Excel: Failed to convert", error);
errors++;
}
else {
console.log("Converted to: " + pdf);
okay++;
}
});
office.powerPoint({
input: "testcases\\test.pptx",
output: "output.ppt." + uuid.v4() + ".pdf"
}, function (error, pdf) {
if (error) {
console.log("PowerPoint: Failed to convert", error);
errors++;
}
else {
console.log("Converted to: " + pdf);
okay++;
}
});
}
console.log("Over and queued");
office.close(null, function() {
console.log("Office finished & closed, ", okay, errors, errors*100/(okay+errors));
});
})