mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 18:40:16 +02:00
Tests: attempt to reduce chance of race condition
This commit is contained in:
parent
3a0c375692
commit
c9e3996007
@ -9,7 +9,8 @@ const sharp = require('../../');
|
|||||||
|
|
||||||
describe('Utilities', function () {
|
describe('Utilities', function () {
|
||||||
describe('Cache', function () {
|
describe('Cache', function () {
|
||||||
it('Can be disabled', function () {
|
it('Can be disabled', function (done) {
|
||||||
|
queueMicrotask(() => {
|
||||||
sharp.cache(false);
|
sharp.cache(false);
|
||||||
const cache = sharp.cache(false);
|
const cache = sharp.cache(false);
|
||||||
assert.strictEqual(cache.memory.current, 0);
|
assert.strictEqual(cache.memory.current, 0);
|
||||||
@ -19,6 +20,8 @@ describe('Utilities', function () {
|
|||||||
assert.strictEqual(cache.files.max, 0);
|
assert.strictEqual(cache.files.max, 0);
|
||||||
assert.strictEqual(cache.items.current, 0);
|
assert.strictEqual(cache.items.current, 0);
|
||||||
assert.strictEqual(cache.items.max, 0);
|
assert.strictEqual(cache.items.max, 0);
|
||||||
|
done();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
it('Can be enabled with defaults', function () {
|
it('Can be enabled with defaults', function () {
|
||||||
const cache = sharp.cache(true);
|
const cache = sharp.cache(true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user