We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5a39e24 commit dd72baaCopy full SHA for dd72baa
test/engines/puppeteer.js
@@ -42,6 +42,34 @@ describe("Puppeteer", function() {
42
}
43
});
44
45
+ it("should render a jpeg", async () => {
46
+ const engine = new puppeteer.Puppeteer();
47
+ await engine.init();
48
+
49
+ try {
50
+ const req = {
51
+ query: {
52
+ url: "https://example.com/",
53
+ format: "jpeg"
54
+ },
55
+ body: {}
56
+ };
57
+ const res = {
58
+ send: function(data) {
59
+ this.data = data;
60
61
+ type: function(file) {
62
+ this.file = file;
63
+ }
64
65
+ await engine.render(req, res);
66
+ assert.ok(res.data);
67
+ assert.strictEqual(res.file, "jpeg");
68
+ } finally {
69
+ await engine.destroy();
70
71
+ });
72
73
it("should open new page", async () => {
74
const engine = new puppeteer.Puppeteer();
75
await engine.init();
0 commit comments