Migrate from mocha to Node.js native test runner

Includes coverage reports when using Node.js 22 onwards
This commit is contained in:
Lovell Fuller
2025-09-21 11:04:55 +01:00
parent c446d743a2
commit f2978651f0
70 changed files with 583 additions and 541 deletions

View File

@@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
const fs = require('node:fs');
const { describe, it } = require('node:test');
const assert = require('node:assert');
const fixtures = require('../fixtures');
@@ -16,7 +17,7 @@ describe('Boolean operation between two images', function () {
sharp.bool.eor
]
.forEach(function (op) {
it(`${op} operation, file`, function (done) {
it(`${op} operation, file`, function (_t, done) {
sharp(fixtures.inputJpg)
.resize(320, 240)
.boolean(fixtures.inputJpgBooleanTest, op)
@@ -28,7 +29,7 @@ describe('Boolean operation between two images', function () {
});
});
it(`${op} operation, buffer`, function (done) {
it(`${op} operation, buffer`, function (_t, done) {
sharp(fixtures.inputJpg)
.resize(320, 240)
.boolean(inputJpgBooleanTestBuffer, op)
@@ -40,7 +41,7 @@ describe('Boolean operation between two images', function () {
});
});
it(`${op} operation, raw`, function (done) {
it(`${op} operation, raw`, function (_t, done) {
sharp(fixtures.inputJpgBooleanTest)
.raw()
.toBuffer(function (err, data, info) {