Tests: remove possible race condition

Simplify JP2 quality size check
This commit is contained in:
Lovell Fuller
2022-03-09 19:55:29 +00:00
parent 9280742385
commit fcbe4e1e01
3 changed files with 10 additions and 14 deletions

View File

@@ -48,15 +48,8 @@ describe('JP2 output', () => {
.resize(320, 240)
.toBuffer(function (err, buffer80) {
if (err) throw err;
sharp(fixtures.inputJp2)
.resize(320, 240)
.jp2({ quality: 90 })
.toBuffer(function (err, buffer90) {
if (err) throw err;
assert(buffer70.length < buffer80.length);
assert(buffer80.length < buffer90.length);
done();
});
assert(buffer70.length < buffer80.length);
done();
});
});
});