mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Tests: convert mocha hooks (#3450)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
const detectLibc = require('detect-libc');
|
||||
const sharp = require('../../');
|
||||
const sharp = require('../');
|
||||
|
||||
const libcFamily = detectLibc.familySync();
|
||||
const usingCache = !(process.env.G_DEBUG || libcFamily === detectLibc.MUSL);
|
||||
@@ -9,14 +9,16 @@ const usingSimd = !(process.env.G_DEBUG || process.env.VIPS_NOVECTOR);
|
||||
const concurrency = process.env.VIPS_CONCURRENCY ||
|
||||
(libcFamily === detectLibc.MUSL || process.arch === 'arm' ? 1 : undefined);
|
||||
|
||||
beforeEach(function () {
|
||||
sharp.cache(usingCache);
|
||||
sharp.simd(usingSimd);
|
||||
sharp.concurrency(concurrency);
|
||||
});
|
||||
exports.mochaHooks = {
|
||||
beforeEach () {
|
||||
sharp.cache(usingCache);
|
||||
sharp.simd(usingSimd);
|
||||
sharp.concurrency(concurrency);
|
||||
},
|
||||
|
||||
afterEach(function () {
|
||||
if (global.gc) {
|
||||
global.gc();
|
||||
afterEach () {
|
||||
if (global.gc) {
|
||||
global.gc();
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user