mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Migrate from mocha to Node.js native test runner
Includes coverage reports when using Node.js 22 onwards
This commit is contained in:
16
test/unit.mjs
Normal file
16
test/unit.mjs
Normal file
@@ -0,0 +1,16 @@
|
||||
import { readdir } from 'node:fs/promises';
|
||||
import { run } from 'node:test';
|
||||
import { spec } from 'node:test/reporters';
|
||||
|
||||
const files = (await readdir('./test/unit')).map((f) => `./test/unit/${f}`);
|
||||
|
||||
run({
|
||||
files,
|
||||
concurrency: true,
|
||||
timeout: 60000,
|
||||
coverage: true,
|
||||
coverageIncludeGlobs: ['lib/*.js'],
|
||||
branchCoverage: 100,
|
||||
})
|
||||
.compose(new spec())
|
||||
.pipe(process.stdout);
|
||||
Reference in New Issue
Block a user