mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Tests: run in parallel again
This commit is contained in:
@@ -5,22 +5,23 @@ const sharp = require('../../');
|
||||
const fixtures = require('../fixtures');
|
||||
|
||||
describe('toFormat', () => {
|
||||
it('accepts upper case characters as format parameter (string)', function (done) {
|
||||
sharp(fixtures.inputJpg)
|
||||
it('accepts upper case characters as format parameter (string)', async () => {
|
||||
const data = await sharp(fixtures.inputJpg)
|
||||
.resize(8, 8)
|
||||
.toFormat('PNG')
|
||||
.toBuffer(function (err, data, info) {
|
||||
if (err) throw err;
|
||||
assert.strictEqual('png', info.format);
|
||||
done();
|
||||
});
|
||||
.toBuffer();
|
||||
|
||||
const { format } = await sharp(data).metadata();
|
||||
assert.strictEqual(format, 'png');
|
||||
});
|
||||
it('accepts upper case characters as format parameter (object)', function (done) {
|
||||
sharp(fixtures.inputJpg)
|
||||
|
||||
it('accepts upper case characters as format parameter (object)', async () => {
|
||||
const data = await sharp(fixtures.inputJpg)
|
||||
.resize(8, 8)
|
||||
.toFormat({ id: 'PNG' })
|
||||
.toBuffer(function (err, data, info) {
|
||||
if (err) throw err;
|
||||
assert.strictEqual('png', info.format);
|
||||
done();
|
||||
});
|
||||
.toBuffer();
|
||||
|
||||
const { format } = await sharp(data).metadata();
|
||||
assert.strictEqual(format, 'png');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user