mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 18:40:16 +02:00
Ensure all WebP tests wait until Promises resolve
This commit is contained in:
parent
76ded7fd28
commit
ba4ce75377
@ -81,15 +81,15 @@ describe('WebP', function () {
|
|||||||
.resize(320, 240)
|
.resize(320, 240)
|
||||||
.webp({ smartSubsample: false })
|
.webp({ smartSubsample: false })
|
||||||
.toBuffer()
|
.toBuffer()
|
||||||
.then(withoutSmartSubsample => {
|
.then(withoutSmartSubsample =>
|
||||||
sharp(fixtures.inputJpg)
|
sharp(fixtures.inputJpg)
|
||||||
.resize(320, 240)
|
.resize(320, 240)
|
||||||
.webp({ smartSubsample: true })
|
.webp({ smartSubsample: true })
|
||||||
.toBuffer()
|
.toBuffer()
|
||||||
.then(withSmartSubsample => {
|
.then(withSmartSubsample => {
|
||||||
assert.strictEqual(true, withSmartSubsample.length > withoutSmartSubsample.length);
|
assert.strictEqual(true, withSmartSubsample.length > withoutSmartSubsample.length);
|
||||||
});
|
})
|
||||||
})
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
it('invalid smartSubsample throws', () => {
|
it('invalid smartSubsample throws', () => {
|
||||||
@ -103,15 +103,15 @@ describe('WebP', function () {
|
|||||||
.resize(320, 240)
|
.resize(320, 240)
|
||||||
.webp()
|
.webp()
|
||||||
.toBuffer()
|
.toBuffer()
|
||||||
.then(reductionEffort4 => {
|
.then(reductionEffort4 =>
|
||||||
sharp(fixtures.inputJpg)
|
sharp(fixtures.inputJpg)
|
||||||
.resize(320, 240)
|
.resize(320, 240)
|
||||||
.webp({ reductionEffort: 6 })
|
.webp({ reductionEffort: 6 })
|
||||||
.toBuffer()
|
.toBuffer()
|
||||||
.then(reductionEffort6 => {
|
.then(reductionEffort6 => {
|
||||||
assert.strictEqual(true, reductionEffort4.length > reductionEffort6.length);
|
assert.strictEqual(true, reductionEffort4.length > reductionEffort6.length);
|
||||||
});
|
})
|
||||||
})
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
it('invalid reductionEffort throws', () => {
|
it('invalid reductionEffort throws', () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user