mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 10:30:15 +02:00
25 lines
516 B
JavaScript
25 lines
516 B
JavaScript
'use strict';
|
|
|
|
const detectLibc = require('detect-libc');
|
|
const sharp = require('../../');
|
|
|
|
const libcFamily = detectLibc.familySync();
|
|
const usingCache = libcFamily !== detectLibc.MUSL;
|
|
const usingSimd = !process.env.G_DEBUG;
|
|
const concurrency =
|
|
libcFamily === detectLibc.MUSL || process.arch === 'arm'
|
|
? 1
|
|
: undefined;
|
|
|
|
beforeEach(function () {
|
|
sharp.cache(usingCache);
|
|
sharp.simd(usingSimd);
|
|
sharp.concurrency(concurrency);
|
|
});
|
|
|
|
afterEach(function () {
|
|
if (global.gc) {
|
|
global.gc();
|
|
}
|
|
});
|