Files: ca90b5ca0579ebdcc0635288bce4978e3fb200f5 / test / test-79-npm / sharp / sharp.js
500 bytesRaw
1 | ; |
2 | |
3 | var sharp = require('sharp'); |
4 | |
5 | var source = Buffer.from( |
6 | '<svg><rect x="0" y="0" width="100" height="100" rx="50" ry="50"/></svg>' |
7 | ); |
8 | |
9 | sharp(source).rotate().toBuffer().then(function (output) { |
10 | if (output.slice(1, 4).toString() === 'PNG') { |
11 | console.log('ok'); |
12 | process.exit(); |
13 | } |
14 | }).catch((error) => { |
15 | console.error(error); |
16 | process.exit(1); |
17 | }); |
18 | |
19 | setTimeout(() => { |
20 | // if test does not pass, it blocks |
21 | // any other way to exit |
22 | process.kill(process.pid); |
23 | }, 3000); |
24 |
Built with git-ssb-web