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

@@ -1,13 +1,14 @@
// Copyright 2013 Lovell Fuller and others.
// SPDX-License-Identifier: Apache-2.0
const { describe, it } = require('node:test');
const assert = require('node:assert');
const sharp = require('../../');
const fixtures = require('../fixtures');
describe('Blur', function () {
it('specific radius 1', function (done) {
it('specific radius 1', function (_t, done) {
sharp(fixtures.inputJpg)
.resize(320, 240)
.blur(1)
@@ -20,7 +21,7 @@ describe('Blur', function () {
});
});
it('specific radius 10', function (done) {
it('specific radius 10', function (_t, done) {
sharp(fixtures.inputJpg)
.resize(320, 240)
.blur(10)
@@ -33,7 +34,7 @@ describe('Blur', function () {
});
});
it('specific options.sigma 10', function (done) {
it('specific options.sigma 10', function (_t, done) {
sharp(fixtures.inputJpg)
.resize(320, 240)
.blur({ sigma: 10 })
@@ -46,7 +47,7 @@ describe('Blur', function () {
});
});
it('specific radius 0.3', function (done) {
it('specific radius 0.3', function (_t, done) {
sharp(fixtures.inputJpg)
.resize(320, 240)
.blur(0.3)
@@ -59,7 +60,7 @@ describe('Blur', function () {
});
});
it('mild blur', function (done) {
it('mild blur', function (_t, done) {
sharp(fixtures.inputJpg)
.resize(320, 240)
.blur()
@@ -78,7 +79,7 @@ describe('Blur', function () {
});
});
it('blurred image is smaller than non-blurred', function (done) {
it('blurred image is smaller than non-blurred', function (_t, done) {
sharp(fixtures.inputJpg)
.resize(320, 240)
.blur(false)