-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
50 lines (43 loc) · 940 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
41
42
43
44
45
46
47
/**
* @test.js Unit test for this app
*
* @author <a href="mailto:dreamind@gmail.com">Ivo Widjaja</a>
* @version 0.0.1
*
* Note: put './deps/processing-js/processing.js' under the root folder of this app
*/
var ProcessingGraphics = require('./lib/processinggraphics');
var fs = require("fs");
// test pdf
ProcessingGraphics.generate(
"http://localhost:2000/pde/simple.pde",
{ width: 400,
height: 400
},
"pdf",
function(rawString) {
fs.writeFile('test.pdf', rawString, 'binary');
}
);
// test jpg
ProcessingGraphics.generate(
"http://localhost:2000/pde/simple.pde",
{ width: 400,
height: 400
},
"jpg",
function(rawString) {
fs.writeFile('test.jpg', rawString, 'binary');
}
);
// test png
ProcessingGraphics.generate(
"http://localhost:2000/pde/simple.pde",
{ width: 400,
height: 400
},
"png",
function(rawString) {
fs.writeFile('test.png', rawString, 'binary');
}
);