diff --git a/CHANGELOG.md b/CHANGELOG.md index d90cfbf..742929a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,19 +1,27 @@ # Changelog -## 6.0.0-dev +## 6.1.0 (August 31, 2026) + +- Added a `{path}` output template for preserving directories matched by glob inputs ([#43](https://github.com/vseventer/sharp-cli/issues/43)). +- Added percentage-based dimensions to the `resize` command ([#49](https://github.com/vseventer/sharp-cli/issues/49)). +- Updated `sharp` dependency to 0.35.4. + +## 6.0.0 (August 21, 2026) - Added [`--limitInputChannels`](https://sharp.pixelplumbing.com/api-constructor/) input option. - Added `--dry` option to process images without writing output files. - Added [`--exact`](https://sharp.pixelplumbing.com/api-output#webp) output option. - Added [`--keepGainMap`](https://sharp.pixelplumbing.com/api-output#keepgainmap) and [`--withGainMap`](https://sharp.pixelplumbing.com/api-output#withgainmap) output options. -- Added `--print` option to print input and output metadata as JSON ([#98](https://github.com/vseventer/sharp-cli/issues/48)). +- Added `--print` option to print input and output metadata as JSON ([#48](https://github.com/vseventer/sharp-cli/issues/48)). - Added [`--tune`](https://sharp.pixelplumbing.com/api-output#avif) output option. - Added [`--withDensity`](https://sharp.pixelplumbing.com/api-output#withdensity) output option. - Added [`--margin`](https://sharp.pixelplumbing.com/api-resize#trim) option to the `trim` command. - Removed `jpg` output format alias; use `jpeg` instead. - Added graceful handling of partial failures during batch image processing ([#98](https://github.com/vseventer/sharp-cli/issues/98)). - Fixes bug where format options could cause errors. Consequently, removed `jpg` output format alias; use `jpeg` instead ([#92](https://github.com/vseventer/sharp-cli/issues/92)). +- Drop `must` dependency in favor of Node.js native `assert`. - Internal refactor from CommonJS to ESM. +- Tightened `yargs` option configuration to require values. - Updated `sharp` dependency to 0.35.3. - Updated dependencies. - Requires Node.js 20.10. diff --git a/README.md b/README.md index 9936d7d..dc8dcf5 100644 --- a/README.md +++ b/README.md @@ -216,7 +216,7 @@ For more information on available options, please visit https://sharp.pixelplumb - The CLI supports input streams. - [Glob](https://www.npmjs.com/package/glob) patterns are allowed, for example `--input './images/**/*.jpg'`. Make sure you quote the pattern when using the CLI. -- Supported output macros: `{root}`, `{dir}`, `{base}`, `{name}`, and `{ext}` (from [Node.js path](https://nodejs.org/api/path.html#path_path_parse_path)), for example: `--output {dir}` will overwrite original files. +- Supported output macros: `{root}`, `{dir}`, `{base}`, `{name}`, and `{ext}` (from [Node.js path](https://nodejs.org/api/path.html#path_path_parse_path)), for example: `--output {dir}` will overwrite original files. Additionally, `{path}` is the directory relative to the non-glob portion of the input path. ``` ┌─────────────────────┬────────────┐ @@ -227,6 +227,14 @@ For more information on available options, please visit https://sharp.pixelplumb └──────┴──────────────┴──────┴─────┘ ``` +For glob input, `{path}` can be used in an `--output` template to preserve the matched directory relative to the non-glob portion of the input path: + +``` +Command: sharp --input './images/**/*.jpg' --output './output/{path}/{name}.webp' +Match: ./images/icons/example.jpg +Output: ./output/icons/example.webp +``` + ## Related - [sharp](http://sharp.pixelplumbing.com/) - API for this module diff --git a/cmd/compositing/composite.js b/cmd/compositing/composite.js index 563878c..3a5a405 100644 --- a/cmd/compositing/composite.js +++ b/cmd/compositing/composite.js @@ -66,18 +66,22 @@ const options = { choices: [3, 4], default: 3, desc: "Number of channels of the blank overlay to be created", + nargs: 1, }, "create.height": { desc: "Height of the blank overlay to be created", + nargs: 1, type: "number", }, "create.width": { desc: "Width of the blank overlay to be created", + nargs: 1, type: "number", }, density: { desc: "Number representing the DPI for vector images", defaultDescription: 72, + nargs: 1, type: "number", }, gravity: { @@ -88,6 +92,7 @@ const options = { left: { desc: "The pixel offset from the left edge", implies: "top", + nargs: 1, type: "number", }, premultiplied: { @@ -101,6 +106,7 @@ const options = { top: { desc: "The pixel offset from the top edge", implies: "left", + nargs: 1, type: "number", }, }; diff --git a/cmd/operations/affine.js b/cmd/operations/affine.js index 2e3aa6b..40c47be 100644 --- a/cmd/operations/affine.js +++ b/cmd/operations/affine.js @@ -45,21 +45,25 @@ const options = { idx: { defaultDescription: "0", desc: "The input horizontal offset", + nargs: 1, type: "number", }, idy: { defaultDescription: "0", desc: "The input vertical offset", + nargs: 1, type: "number", }, odx: { defaultDescription: "0", desc: "The output horizontal offset", + nargs: 1, type: "number", }, ody: { defaultDescription: "0", desc: "The output vertical offset", + nargs: 1, type: "number", }, interpolate: { diff --git a/cmd/operations/blur.js b/cmd/operations/blur.js index 83031d7..5050ec7 100644 --- a/cmd/operations/blur.js +++ b/cmd/operations/blur.js @@ -36,6 +36,7 @@ const options = { minAmplitude: { defaultDescription: 0.2, desc: "A smaller value will generate a larger, more accurate mask", + nargs: 1, type: "number", }, precision: { diff --git a/cmd/operations/clahe.js b/cmd/operations/clahe.js index 117ef30..72c5938 100644 --- a/cmd/operations/clahe.js +++ b/cmd/operations/clahe.js @@ -39,6 +39,7 @@ const options = { maxSlope: { defaultDescription: 3, desc: "Maximum value for the slope of the cumulative histogram", + nargs: 1, type: "number", }, }; diff --git a/cmd/operations/convolve.js b/cmd/operations/convolve.js index 47b583f..04e94e7 100644 --- a/cmd/operations/convolve.js +++ b/cmd/operations/convolve.js @@ -48,11 +48,13 @@ const options = { scale: { desc: "The scale of the kernel in pixels", defaultDescription: "sum", + nargs: 1, type: "number", }, offset: { desc: "The offset of the kernel in pixels", defaultDescription: "0", + nargs: 1, type: "number", }, }; diff --git a/cmd/operations/modulate.js b/cmd/operations/modulate.js index 3aa53e6..8b10b6d 100644 --- a/cmd/operations/modulate.js +++ b/cmd/operations/modulate.js @@ -30,18 +30,22 @@ import { pick } from "../../lib/utils.js"; const options = { brightness: { desc: "Brightness multiplier", + nargs: 1, type: "number", }, hue: { desc: "Degrees for hue rotation", + nargs: 1, type: "number", }, lightness: { desc: "Lightness addend", + nargs: 1, type: "number", }, saturation: { desc: "Saturation multiplier", + nargs: 1, type: "number", }, }; diff --git a/cmd/operations/normalise.js b/cmd/operations/normalise.js index eff86c2..d02311d 100644 --- a/cmd/operations/normalise.js +++ b/cmd/operations/normalise.js @@ -30,11 +30,13 @@ const options = { lower: { default: 1, desc: "Percentile below which luminance values will be underexposed", + nargs: 1, type: "number", }, upper: { default: 99, desc: "Percentile below which luminance values will be overexposed", + nargs: 1, type: "number", }, }; diff --git a/cmd/operations/sharpen.js b/cmd/operations/sharpen.js index ccec3d6..a787d0d 100644 --- a/cmd/operations/sharpen.js +++ b/cmd/operations/sharpen.js @@ -40,27 +40,32 @@ const options = { alias: "flat", desc: 'The level of sharpening to apply to "flat" areas', defaultDescription: 1.0, + nargs: 1, type: "number", }, m2: { alias: "jagged", desc: 'The level of sharpening to apply to "jagged" areas', defaultDescription: 2.0, + nargs: 1, type: "number", }, x1: { desc: 'The threshold between "flat" and "jagged" areas', defaultDescription: 2.0, + nargs: 1, type: "number", }, y2: { desc: "The maximum amount of brightening", defaultDescription: 10.0, + nargs: 1, type: "number", }, y3: { desc: "The maximum amount of darkening", defaultDescription: 20.0, + nargs: 1, type: "number", }, }; diff --git a/cmd/output.js b/cmd/output.js index d100191..c504168 100644 --- a/cmd/output.js +++ b/cmd/output.js @@ -41,6 +41,7 @@ const options = { choices: [0, 90, 180, 270], defaultDescription: "0", desc: "Tile angle of rotation", + nargs: 1, }, background: { defaultDescription: "rgb(255, 255, 255, 1)", @@ -79,11 +80,13 @@ const options = { overlap: { desc: "Tile overlap in pixels", defaultDescription: "0", + nargs: 1, type: "number", }, skipBlanks: { defaultDescription: -1, desc: "Threshold to skip tile generation", + nargs: 1, type: "number", }, }; diff --git a/cmd/resizing/resize.js b/cmd/resizing/resize.js index d9520dc..ee94331 100644 --- a/cmd/resizing/resize.js +++ b/cmd/resizing/resize.js @@ -27,17 +27,31 @@ import constants from "../../lib/constants.js"; import { pick } from "../../lib/utils.js"; +// Helpers. +const resolveDimension = (dimension, metadataDimension) => { + if (dimension == null) return null; + if (typeof dimension === "string" && dimension.endsWith("%")) { + if (metadataDimension == null) { + throw new Error("Input metadata is required to resolve percentage"); + } + return Math.round( + (metadataDimension * Number(dimension.slice(0, -1))) / 100, + ); + } + return Number(dimension); +}; + // Configure. const positionals = { width: { default: null, - desc: "Pixels wide the resultant image should be", - type: "number", + desc: "Pixels or percentage wide the resultant image should be", + type: "string", }, height: { default: null, - desc: "Pixels high the resultant image should be", - type: "number", + desc: "Pixels or percentage high the resultant image should be", + type: "string", }, }; @@ -94,6 +108,10 @@ const builder = (yargs) => { "$0 resize --height 100", "The output will be 100 pixels high, auto-scaled width", ) + .example( + "$0 resize 50%", + "The output will be 50% of the input width, auto-scaled height", + ) .example( '$0 resize 200 300 --background rgba(255,255,255,0.5) --fit contain --kernel nearest --position "right top"', "The output will be 200 pixels wide and 300 pixels high containing a nearest-neighbour scaled version contained within the north-east corner of a semi-transparent white canvas", @@ -132,8 +150,10 @@ const handler = (args) => { // @see https://sharp.pixelplumbing.com/api-resize#resize return args["#queue"].push([ "resize", - (sharp) => { - return sharp.resize(args.width, args.height, pick(args, optionNames)); + (sharp, { metadata } = {}) => { + const width = resolveDimension(args.width, metadata?.width); + const height = resolveDimension(args.height, metadata?.height); + return sharp.resize(width, height, pick(args, optionNames)); }, ]); }; diff --git a/cmd/resizing/trim.js b/cmd/resizing/trim.js index 06c55f3..ac3a17b 100644 --- a/cmd/resizing/trim.js +++ b/cmd/resizing/trim.js @@ -45,6 +45,7 @@ const options = { }, margin: { desc: "Leave a margin around trimmed content", + nargs: 1, type: "number", }, }; diff --git a/lib/cli.js b/lib/cli.js index 1375a62..008aaea 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -140,6 +140,7 @@ export const inputOptions = { desc: "DPI for vector images", defaultDescription: 72, group: input, + nargs: 1, type: "number", }, failOn: { @@ -158,30 +159,35 @@ export const inputOptions = { desc: "Level to extract from a multi-level input (OpenSlide), zero based", defaultDescription: 0, group: input, + nargs: 1, type: "number", }, limitInputPixels: { defaultDescription: 0x3fff * 0x3fff, desc: "Do not process input images where the number of pixels (width x height) exceeds this limit", group: input, + nargs: 1, type: "number", }, limitInputChannels: { defaultDescription: 5, desc: "Do not process input images where the number of channels exceeds this limit", group: input, + nargs: 1, type: "number", }, page: { defaultDescription: 0, desc: "Page number to start extracting from for multi-page input", group: input, + nargs: 1, type: "number", }, pages: { defaultDescription: 1, desc: "Number of pages to extract for multi-page input", group: input, + nargs: 1, type: "number", }, pdfBackground: { @@ -199,6 +205,7 @@ export const inputOptions = { defaultDescription: -1, desc: "subIFD to extract for OME-TIFF", group: input, + nargs: 1, type: "number", }, unlimited: { @@ -222,6 +229,7 @@ const outputOptions = { desc: "zlib compression level", defaultDescription: 6, group: output, + nargs: 1, type: "number", }, @@ -259,6 +267,7 @@ const outputOptions = { "metadata.density": { desc: "Number of pixels per inch (DPI)", group: output, + nargs: 1, type: "number", }, "metadata.exif": { @@ -276,6 +285,7 @@ const outputOptions = { "metadata.orientation": { desc: "Used to update the EXIF Orientation tag", group: output, + nargs: 1, type: "number", }, @@ -283,6 +293,7 @@ const outputOptions = { withDensity: { desc: "Set output density (DPI) in EXIF metadata", group: output, + nargs: 1, type: "number", }, @@ -312,6 +323,7 @@ const outputOptions = { desc: "Quality", defaultDescription: "80", group: output, + nargs: 1, type: "number", }, }; @@ -329,6 +341,7 @@ const optimizationOptions = { desc: "Quality of alpha layer", defaultDescription: "80", group: optimize, + nargs: 1, type: "number", }, @@ -338,6 +351,7 @@ const optimizationOptions = { defaultDescription: 8, desc: "Reduce bitdepth to 1, 2, or 4 bit", group: optimize, + nargs: 1, }, // @see https://sharp.pixelplumbing.com/api-output#avif @@ -356,6 +370,7 @@ const optimizationOptions = { defaultDescription: 256, desc: "Maximum number of palette entries", group: optimize, + nargs: 1, type: "number", }, @@ -371,6 +386,7 @@ const optimizationOptions = { delay: { desc: "Delay(s) between animation frames", group: optimize, + nargs: 1, type: "number", }, @@ -380,6 +396,7 @@ const optimizationOptions = { desc: "Level of Floyd-Steinberg error diffusion", defaultDescription: "1.0", group: optimize, + nargs: 1, type: "number", }, @@ -392,6 +409,7 @@ const optimizationOptions = { defaultDescription: "7 (GIF, PNG) / 4", desc: "Level of CPU effort to reduce file size", group: optimize, + nargs: 1, type: "number", }, @@ -408,6 +426,7 @@ const optimizationOptions = { defaultDescription: 8, desc: "Set bitdepth to 8, 10, or 12 bit", group: optimize, + nargs: 1, }, // @see https://sharp.pixelplumbing.com/api-output#heif @@ -422,6 +441,7 @@ const optimizationOptions = { interFrameMaxError: { desc: "Maximum inter-frame error for transparency", group: optimize, + nargs: 1, type: "number", }, @@ -429,6 +449,7 @@ const optimizationOptions = { interPaletteMaxError: { desc: "Maximum inter-palette error for palette reuse", group: optimize, + nargs: 1, type: "number", }, @@ -437,6 +458,7 @@ const optimizationOptions = { default: 0, desc: "Number of animation iterations", group: optimize, + nargs: 1, type: "number", }, @@ -552,6 +574,7 @@ const optimizationOptions = { defaultDescription: "0", desc: "Quantization table to use", group: optimize, + nargs: 1, type: "number", }, @@ -597,6 +620,7 @@ const optimizationOptions = { tileHeight: { desc: "Vertical tile size", group: optimize, + nargs: 1, type: "number", }, @@ -604,6 +628,7 @@ const optimizationOptions = { tileWidth: { desc: "Horizontal tile size", group: optimize, + nargs: 1, type: "number", }, @@ -628,6 +653,7 @@ const optimizationOptions = { defaultDescription: "1.0", desc: "Horizontal resolution", group: optimize, + nargs: 1, type: "number", }, @@ -636,6 +662,7 @@ const optimizationOptions = { defaultDescription: "1.0", desc: "Vertical resolution", group: optimize, + nargs: 1, type: "number", }, }; diff --git a/lib/convert.js b/lib/convert.js index 9a926f9..fb2aa23 100644 --- a/lib/convert.js +++ b/lib/convert.js @@ -23,6 +23,7 @@ // Standard lib. import { createReadStream } from "node:fs"; +import { mkdir } from "node:fs/promises"; import path from "node:path"; import { pipeline } from "node:stream/promises"; @@ -55,26 +56,49 @@ const FORMATS = { ".webp": "webp", }; +// Resolve the non-magic portion of a glob to use as its relative path root. +const getGlobRoot = (pattern) => { + const absolute = path.resolve(pattern); + const magicIndex = absolute.search(/[*?[{(]/); + if (magicIndex === -1) { + return path.dirname(absolute); + } + + const prefix = absolute.slice(0, magicIndex); + return prefix.endsWith(path.sep) + ? path.resolve(prefix) + : path.dirname(path.resolve(prefix)); +}; + // Exports. export default { // Convert a list of files. files: async (input, output, context) => { // Resolve files. - const files = input.flatMap((input) => globSync(input, { absolute: true })); + const files = input.flatMap((pattern) => { + const root = getGlobRoot(pattern); + return globSync(pattern, { absolute: true }).map((src) => ({ + root, + src, + })); + }); if (files.length === 0) { throw new Error("No input files"); } // Process files. const isBatch = files.length > 1; - const promises = files.map((src) => { + const promises = files.map(({ root, src }) => { const image = sharp(context.options); return pipeline(createReadStream(src), image) .then(() => image.metadata()) .then((metadata) => { // Process output as a template. - const parts = path.parse(src); - const regex = /\{(root|dir|base|ext|name)\}/g; + const parts = { + ...path.parse(src), + path: path.relative(root, path.dirname(src)), + }; + const regex = /\{(root|dir|path|base|ext|name)\}/g; let dest = output; let match; while ((match = regex.exec(output)) !== null) { @@ -110,7 +134,9 @@ export default { ? transformer .toBuffer({ resolveWithObject: true }) .then(({ info }) => info) - : transformer.toFile(dest); + : mkdir(path.dirname(dest), { recursive: true }).then(() => + transformer.toFile(dest), + ); return promise.then((info) => ({ input: inputMetadata, output: { ...info, path: dest }, diff --git a/package-lock.json b/package-lock.json index 704c9a1..82c9176 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,16 +1,16 @@ { "name": "sharp-cli", - "version": "6.0.0-dev", + "version": "6.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "sharp-cli", - "version": "6.0.0-dev", + "version": "6.1.0", "license": "MIT", "dependencies": { "glob": "13.0.x", - "sharp": "0.35.3", + "sharp": "0.35.4", "yargs": "17.7.x" }, "bin": { @@ -23,7 +23,6 @@ "fs-extra": "11.4.x", "globals": "17.11.x", "mocha": "11.8.x", - "must": "0.13.x", "nyc": "18.0.x", "prettier": "3.9.x", "sinon": "22.1.x", @@ -457,6 +456,7 @@ "version": "1.11.3", "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.3.tgz", "integrity": "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA==", + "license": "MIT", "optional": true, "dependencies": { "tslib": "^2.4.0" @@ -706,12 +706,13 @@ } }, "node_modules/@img/sharp-darwin-arm64": { - "version": "0.35.3", - "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.35.3.tgz", - "integrity": "sha512-RMnFX7YQsMoh7lWfcM4NEHHymBX/rLuKNPVM84XE9ONPcaSCDgE7CHIHpSgPcO2xcRthgBy1HfNO319mwhIAkg==", + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.35.4.tgz", + "integrity": "sha512-Uhfl4V4lhP2nbUVF9+hyH1+luj86f1gUFeo8ALYxFoULoU+G87D43BfeMP8XHsk9boxAnCY/bf2EHwhA7MuGsA==", "cpu": [ "arm64" ], + "license": "Apache-2.0", "optional": true, "os": [ "darwin" @@ -723,16 +724,17 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-darwin-arm64": "1.3.2" + "@img/sharp-libvips-darwin-arm64": "1.3.3" } }, "node_modules/@img/sharp-darwin-x64": { - "version": "0.35.3", - "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.35.3.tgz", - "integrity": "sha512-Xo+5uFBtLN0BKqieTxiFzFPQAUlBbbH5iBKyRX/z1JrbnYsHTfKJnUfL8+p2TPXr1pXqao4eeL4Rl144uDpK9w==", + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.35.4.tgz", + "integrity": "sha512-hWniXY3bG5qKpkKrAwPe4y+VTPmf086YQAnkxWh7uA1YrlRouWGa0M0Mxj3ZjnXFkv7/TD1bTy9lGUK26vRvWw==", "cpu": [ "x64" ], + "license": "Apache-2.0", "optional": true, "os": [ "darwin" @@ -744,19 +746,20 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-darwin-x64": "1.3.2" + "@img/sharp-libvips-darwin-x64": "1.3.3" } }, "node_modules/@img/sharp-freebsd-wasm32": { - "version": "0.35.3", - "resolved": "https://registry.npmjs.org/@img/sharp-freebsd-wasm32/-/sharp-freebsd-wasm32-0.35.3.tgz", - "integrity": "sha512-lUxcqWIj2wMQ9BrwNjngcr1gWUr5xgaGThBRqPPalIC2n67Cqj1uPh8NnA/ZhAg8hUbKl+kVHKwgUIwe6ZYPrg==", + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/@img/sharp-freebsd-wasm32/-/sharp-freebsd-wasm32-0.35.4.tgz", + "integrity": "sha512-lIsKw/BU+kjB4eZjxrYrZmwOJYi3Ajrv66iAlBmUPyKc3HpnloevB1g3wxGD9P/5BbQ1brBGl65VRRrCvQDEqA==", + "license": "Apache-2.0", "optional": true, "os": [ "freebsd" ], "dependencies": { - "@img/sharp-wasm32": "0.35.3" + "@img/sharp-wasm32": "0.35.4" }, "engines": { "node": ">=20.9.0" @@ -766,12 +769,13 @@ } }, "node_modules/@img/sharp-libvips-darwin-arm64": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.3.2.tgz", - "integrity": "sha512-9J6ypZFpQBj4YnePGoq/S38w6nz+vqg5WZLrLGY4YuSemdMq47GMLBPO42MzwdGwpg/agZ7xzZcFHa48xlywfg==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.3.3.tgz", + "integrity": "sha512-suTBPTDGrI9WodccaDdwZItTSaBYASlBk1NSfElSHrUfzu3szG6lvIF58+WiFvnfzuK8ZBFS5zE00PxqxnRiPg==", "cpu": [ "arm64" ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "darwin" @@ -781,12 +785,13 @@ } }, "node_modules/@img/sharp-libvips-darwin-x64": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.3.2.tgz", - "integrity": "sha512-m2pW1n6cns9VaubNwsZ+c3CRYjxNQWgJ5gPlnL1nbBcpkBvFm6SCFN5o0psFHI8w9n11NKhFkeEDns98tiqbEw==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.3.3.tgz", + "integrity": "sha512-FVJZ5mITMobmXIz/hPDTw0EintTW5H3WfrxwLqEqjiIihlu+hVRyGrFQ60xl0Lxn7Bt3zdpevPaQi0HEzqz9fw==", "cpu": [ "x64" ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "darwin" @@ -796,12 +801,13 @@ } }, "node_modules/@img/sharp-libvips-linux-arm": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.3.2.tgz", - "integrity": "sha512-1eMLzy92I4J6rmi4mAT8yC3HxOtniyGELlzGbNMLLeqe052ahFQ0h6LFq+lh5DsDIdYViIDst08abvSbcEdLXQ==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.3.3.tgz", + "integrity": "sha512-3rbU4vqXXc3hY/OiXdl52xZvT0F1yEngWfvqudtPJg/KkyiaQw2DRsFrNzpmLvfavbwOq3qXn36GP8obHRULQA==", "cpu": [ "arm" ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "linux" @@ -811,12 +817,13 @@ } }, "node_modules/@img/sharp-libvips-linux-arm64": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.3.2.tgz", - "integrity": "sha512-dqVSFynCox4C/J8kT16V7SIFAns0IjgLwkvYT7p8LQVmJ5OS5b6tI9IGflxTeuBS//zXeFIUbwt5dwxyZ17cnA==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.3.3.tgz", + "integrity": "sha512-0DaL0A6Xu6sQSQFwe4iVCrKWU2cCTItnRsYsCdxAMm9NF6twAA9BKnoqy4hqz4+azQ0JHuA26qiUKsf1XJ/v5A==", "cpu": [ "arm64" ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "linux" @@ -826,12 +833,13 @@ } }, "node_modules/@img/sharp-libvips-linux-ppc64": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.3.2.tgz", - "integrity": "sha512-3z0NHDxD6n5I9gc05U1eW1AyRm+Gznzq3naMrthPNqE6oYykcogW0l/jfpJdjYnuNl8R7yI9pNbE1XiUeyq0Aw==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.3.3.tgz", + "integrity": "sha512-cdn1OvUBwsXhbC0zSzJnNzf5MZ/mTrobawDvNXBTxe8VtqKAm0sRuEY2Evzovb/w9JMk4TvRxqt1mekSuJz64w==", "cpu": [ "ppc64" ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "linux" @@ -841,12 +849,13 @@ } }, "node_modules/@img/sharp-libvips-linux-riscv64": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.3.2.tgz", - "integrity": "sha512-bsb4rI+NldGOsXuej2r8OdSS8+zXDVaCWxyWrcv6kneTOlgAHtZABRzBBCwdsPiD90J4myNJuHpg6kA20ImW/w==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.3.3.tgz", + "integrity": "sha512-HjPVx7yKz+0lqdhDlTw1tt90wamBoxhiXpvl1XZpJLiHH4RCJ5yDTqH+VlYPv2fwFs89JFw4c1IexYOcQUi4IQ==", "cpu": [ "riscv64" ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "linux" @@ -856,12 +865,13 @@ } }, "node_modules/@img/sharp-libvips-linux-s390x": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.3.2.tgz", - "integrity": "sha512-/ABshyj8gCpyIrNXnHn4LorDJ0HHm1VhXPBlxZ8zAtfVPAaSafXPGn+sUSIRiwaSBy0mmFjSjiXI5mkcwdChKQ==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.3.3.tgz", + "integrity": "sha512-neWLh+3yCNThxnfy3c4BbVBeGgt9aftno+XbT56iK28RgeDs3UOFWviLWlUu0bArYVYJaFDK+RRohbicUNCm8Q==", "cpu": [ "s390x" ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "linux" @@ -871,12 +881,13 @@ } }, "node_modules/@img/sharp-libvips-linux-x64": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.3.2.tgz", - "integrity": "sha512-ITPEtgffGJ0S6G9dRyw/366tJQqFRcHWPHhC+Stpg3Z8AEMrDrTr2lhdz4f/Y/HMbRh//7Z5mBzEpVdi62Oc3w==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.3.3.tgz", + "integrity": "sha512-4vKmvAst9nrowcqquKFAyZJUDolUaIp8uRiN0mWFguJ1IplC9/pitXtlnnlU4aa/eJw3J7i67V+pwUL+wZGdsA==", "cpu": [ "x64" ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "linux" @@ -886,12 +897,13 @@ } }, "node_modules/@img/sharp-libvips-linuxmusl-arm64": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.3.2.tgz", - "integrity": "sha512-zE9EdiUzUmg5mDT5a1rk5fYJ6GWPloTwWBYDS14naqHsL+EaMpDj1AWnpLgh3u0YCORv2Tt50wrcrpYqkP97Kw==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.3.3.tgz", + "integrity": "sha512-Y9kQaLMuNoB0bPYOOdcZMaseNrFpPodIWWMrx+CZyydf2xn68j9WYc6sWWRrDwNkzCQjKYfc68L7jKjGlHMibw==", "cpu": [ "arm64" ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "linux" @@ -901,12 +913,13 @@ } }, "node_modules/@img/sharp-libvips-linuxmusl-x64": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.3.2.tgz", - "integrity": "sha512-m0lrLiUt+lBYnCFr8qV/65yMR4E/c7/wf78I5eKTdkEakFAlZ9QlzEM3QIhhAwVeUhLAHLcCq7a7Vszq/oFNZQ==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.3.3.tgz", + "integrity": "sha512-fj8Mv0HHfD1Rr+4I68+3agJynxDWtBFgicTbSOb9Bke6pIwzGcJ+RX/yHjmiEGFMCavY/dxvem7MyNaJF+wDiw==", "cpu": [ "x64" ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "linux" @@ -916,12 +929,13 @@ } }, "node_modules/@img/sharp-linux-arm": { - "version": "0.35.3", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.35.3.tgz", - "integrity": "sha512-affVWCTLooy8TSxbDx2qkzuDeaWLNVBA+P//FNBirHsXpP2fuBhk5AuboYUnrDnzoXes8GFjpTx0SBFOCRg+FA==", + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.35.4.tgz", + "integrity": "sha512-7OAS8gI0EReKGVN2HssHlM6umJgxF5VI3xN0p9FA91p/YO+ou5hiNghLdZ5BEHztwaaK5+bLKRf8x/o2L2nk9A==", "cpu": [ "arm" ], + "license": "Apache-2.0", "optional": true, "os": [ "linux" @@ -933,16 +947,17 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-arm": "1.3.2" + "@img/sharp-libvips-linux-arm": "1.3.3" } }, "node_modules/@img/sharp-linux-arm64": { - "version": "0.35.3", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.35.3.tgz", - "integrity": "sha512-QgKDspHPnrU+GQ55XPhGwyhC8acLVOOSyAvo1oVfFmrIXLkDNmGWzAfDZ4xK8oSA1qBQrALcHX0G5UZni/SuFQ==", + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.35.4.tgz", + "integrity": "sha512-De4jpEnAU8Hd5oT0j1G3uL4ZvTuipVMn7YC6vPaJhy6/7EwEae0SVAoBrUMYQbkLGDm85taVWwuPc1a44LTzCQ==", "cpu": [ "arm64" ], + "license": "Apache-2.0", "optional": true, "os": [ "linux" @@ -954,16 +969,17 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-arm64": "1.3.2" + "@img/sharp-libvips-linux-arm64": "1.3.3" } }, "node_modules/@img/sharp-linux-ppc64": { - "version": "0.35.3", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.35.3.tgz", - "integrity": "sha512-sMd8rDxmpLOwv/7N44klFjOD5DUO7FLdjiXDI0hoxYaf7Ar262dQIEkosE98bps+5HPLtp/EvNqeqQtOycP/IA==", + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.35.4.tgz", + "integrity": "sha512-2oYZJeIl4kCcMGk4ouZVjnkCtFrpQFlNEtJ6GbxzhHQchwH0NH/qEb9ykmOl29dqwMq+JhFdZn+1ak2FKhI9fQ==", "cpu": [ "ppc64" ], + "license": "Apache-2.0", "optional": true, "os": [ "linux" @@ -975,16 +991,17 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-ppc64": "1.3.2" + "@img/sharp-libvips-linux-ppc64": "1.3.3" } }, "node_modules/@img/sharp-linux-riscv64": { - "version": "0.35.3", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.35.3.tgz", - "integrity": "sha512-0Eob78yjlYPfL5vMNWAW55l3R9Y6BQS/gOfe0ZcP9mEz9ohhKSt4im1hayiknXgf8AWrFqMvJcKIdmLmEe7yeQ==", + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.35.4.tgz", + "integrity": "sha512-cPbNChoRURAWdebDIHSenxRpgEdy7JkPydSnUxRm9VvKD7m0/xVaR/8Fzlu81pk5nHEvHH87UZUA7cTtwnbJSA==", "cpu": [ "riscv64" ], + "license": "Apache-2.0", "optional": true, "os": [ "linux" @@ -996,16 +1013,17 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-riscv64": "1.3.2" + "@img/sharp-libvips-linux-riscv64": "1.3.3" } }, "node_modules/@img/sharp-linux-s390x": { - "version": "0.35.3", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.35.3.tgz", - "integrity": "sha512-KgAxQ0DxpNOq1rG2t5cgTgShJFGSuU7XO45cqC+1NVOuZnP6tlgZRuSYOfNupGkHID0o3cJOsw4DVeJpMovcGw==", + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.35.4.tgz", + "integrity": "sha512-RY0JFY8Fd6RonCBtHz+DvadaPkXDSI1AUn6yWL9TipqkZ1vY8w8evqdgyDFnkm4/K1ve1TvZiaePP5oSd4+WVQ==", "cpu": [ "s390x" ], + "license": "Apache-2.0", "optional": true, "os": [ "linux" @@ -1017,16 +1035,17 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-s390x": "1.3.2" + "@img/sharp-libvips-linux-s390x": "1.3.3" } }, "node_modules/@img/sharp-linux-x64": { - "version": "0.35.3", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.35.3.tgz", - "integrity": "sha512-8pqvxubL2PGdhlPy6GLqzDYMUjyRmKAwKHYKixpdJYBUK7PJ0C029XdsnpFIdgRZG68fZiGdHVWcKPvtiPB4cA==", + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.35.4.tgz", + "integrity": "sha512-9qvvEAuk8k89TfWUoX2htWjbAMX8p+NxCppjpcg5k6xMsjhBQPTsoIh36h9Qde4WRuGpJeYnOjdosDn/cnv+OA==", "cpu": [ "x64" ], + "license": "Apache-2.0", "optional": true, "os": [ "linux" @@ -1038,16 +1057,17 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-x64": "1.3.2" + "@img/sharp-libvips-linux-x64": "1.3.3" } }, "node_modules/@img/sharp-linuxmusl-arm64": { - "version": "0.35.3", - "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.35.3.tgz", - "integrity": "sha512-Vz0iQjzzcSX3HCbfwFfCSG/9SCIqyO0mH2sXyiHaAYfBk0cRsCWXRyQYX0ovCK/PAQBbTzQ0dsPQHh5MAFL59w==", + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.35.4.tgz", + "integrity": "sha512-KB5jxpfWQTr0nc3xdHtWChdbifHrBGsd2SM62Eyxrl8afikm+f5qGBU75SJIZBT/S1MC8XyacdlXBMSWq6OURA==", "cpu": [ "arm64" ], + "license": "Apache-2.0", "optional": true, "os": [ "linux" @@ -1059,16 +1079,17 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linuxmusl-arm64": "1.3.2" + "@img/sharp-libvips-linuxmusl-arm64": "1.3.3" } }, "node_modules/@img/sharp-linuxmusl-x64": { - "version": "0.35.3", - "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.35.3.tgz", - "integrity": "sha512-6O1NPKcDVj9QEdg7Hx549EX8U0rp6yXQERqru6yRN7fGBn32UvIRJUlWnk+8xDCiG76hXVBbX82NZ/ZKr0euIg==", + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.35.4.tgz", + "integrity": "sha512-f+eZJZIQNEEd26RPSW+76chwOf1XtA2Y/O+5ocVyLliHkeih3e+jhLVBdNTd2rS3IbNXK8+ug93Vf5ZXtF5Lxg==", "cpu": [ "x64" ], + "license": "Apache-2.0", "optional": true, "os": [ "linux" @@ -1080,16 +1101,17 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linuxmusl-x64": "1.3.2" + "@img/sharp-libvips-linuxmusl-x64": "1.3.3" } }, "node_modules/@img/sharp-wasm32": { - "version": "0.35.3", - "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.35.3.tgz", - "integrity": "sha512-cZ0XkcYGpHZkqW6iCkqTcmUC0CD9DhD5d/qeZlZkfRBn6GnHniZXLUo5+9xw8Iv76YE6LQFN9YNBlKREcCG76w==", + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.35.4.tgz", + "integrity": "sha512-zQnl4Kwp7Q6NHsENtU2T/00Zi+w3AQNwz3+UaTyVBy2FpXrzXzGjndpK61onhZjRtRpQXxCTeqw19bVyXOh7jA==", + "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", "optional": true, "dependencies": { - "@emnapi/runtime": "^1.11.1" + "@emnapi/runtime": "^1.11.3" }, "engines": { "node": ">=20.9.0" @@ -1099,15 +1121,16 @@ } }, "node_modules/@img/sharp-webcontainers-wasm32": { - "version": "0.35.3", - "resolved": "https://registry.npmjs.org/@img/sharp-webcontainers-wasm32/-/sharp-webcontainers-wasm32-0.35.3.tgz", - "integrity": "sha512-2rnq7bX3NzeR2T4YWgz8qiG4h3TSdMe+vN1iQXpJleSJ3SM5zQ8Fy2SyyXAWlbxpEZ2Y+Z4u1BePgJEYbSy80Q==", + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/@img/sharp-webcontainers-wasm32/-/sharp-webcontainers-wasm32-0.35.4.tgz", + "integrity": "sha512-ESfNkywmCfPNyaZjxooddJQiQ+l/nTpGEOGthxiLnIHXC/CmcBixnfwUleX9mCz9ovrUUvKMap/pm8RYbzfwaA==", "cpu": [ "wasm32" ], + "license": "Apache-2.0", "optional": true, "dependencies": { - "@img/sharp-wasm32": "0.35.3" + "@img/sharp-wasm32": "0.35.4" }, "engines": { "node": ">=20.9.0" @@ -1117,12 +1140,13 @@ } }, "node_modules/@img/sharp-win32-arm64": { - "version": "0.35.3", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.35.3.tgz", - "integrity": "sha512-4bPwFdMbeC4JQ8L8LOyWp6nsHcboP5fxkp6iPOXz2Vg49R42TuMs2whkJ5OAP4/Ul035qOzy0AecOF9VOscn4w==", + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.35.4.tgz", + "integrity": "sha512-iNdlBX9gLVvqe2I3uIJSIKTq6wckP/DYxZtcqxm09x5Gi24DnFBmPAWZmr60ZyYMG0xlzo6goG3670ar+RXvRw==", "cpu": [ "arm64" ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", "optional": true, "os": [ "win32" @@ -1135,12 +1159,13 @@ } }, "node_modules/@img/sharp-win32-ia32": { - "version": "0.35.3", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.35.3.tgz", - "integrity": "sha512-r53mXsBN6lFUDiST764SvgwUdHAqM4rPAiDzAmf4fLoB6X/rkfyTrLCg6+g17wJJiCmB3JYgHuUldCWUIRFSXw==", + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.35.4.tgz", + "integrity": "sha512-kqRsbaa5CS6KHlpxnN7WhE6vAAugXyZButpRdvDWetlv6Qv4N9WTcrWzF7tXfB9T7MsoadqdI8hmwLq6UlLvtw==", "cpu": [ "ia32" ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", "optional": true, "os": [ "win32" @@ -1153,12 +1178,13 @@ } }, "node_modules/@img/sharp-win32-x64": { - "version": "0.35.3", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.35.3.tgz", - "integrity": "sha512-D4y1vNeZrIIJCN+uHaWVtH86B+aCrdMYYjicy9pXHvbGZeGYLLSd3wdVuC37FxVXlU1ARsk84eKWfWMXGYEqvA==", + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.35.4.tgz", + "integrity": "sha512-XtmnYhBcrORsJ4XJngyzr/EWP0hRZLAZRFaApdKuviyqF78+ylxh2y06ZmtULAMOnObJ3ucpN0AcwSWnMowTRg==", "cpu": [ "x64" ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", "optional": true, "os": [ "win32" @@ -1832,9 +1858,9 @@ } }, "node_modules/diff": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", - "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==", + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/diff/-/diff-8.0.3.tgz", + "integrity": "sha512-qejHi7bcSD4hQAZE0tNAawRK1ZtafHDmMTMkrrIGgSLl7hTnQHmKCeB45xAcbfTqK2zowkM3j3bHt/4b/ARbYQ==", "dev": true, "engines": { "node": ">=0.3.1" @@ -1846,15 +1872,6 @@ "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "dev": true }, - "node_modules/egal": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/egal/-/egal-1.3.0.tgz", - "integrity": "sha512-K3oJQTVoCyBA1xpmHcTUPxsOuiJXDfAO9Ts2ScP2z96dxPR8g680A0BG8owH5Pwh+5FQm4M2iWv0CTwPUtLrJA==", - "dev": true, - "dependencies": { - "kindof": ">= 2.0.0 < 3" - } - }, "node_modules/electron-to-chromium": { "version": "1.5.406", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.406.tgz", @@ -2759,12 +2776,6 @@ "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", "dev": true }, - "node_modules/json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", - "dev": true - }, "node_modules/json5": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", @@ -2798,12 +2809,6 @@ "json-buffer": "3.0.1" } }, - "node_modules/kindof": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/kindof/-/kindof-2.0.0.tgz", - "integrity": "sha512-ZjkyNRo87FUdtxtpx/MLmePxaLoAhipw0CSTNgX50S1BQhPnsjkgZ/Vso0tR9pbfrzzQiAn+MSFooZAr/GfUNw==", - "dev": true - }, "node_modules/levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", @@ -2829,21 +2834,6 @@ "node": ">=8" } }, - "node_modules/lodash._createwrapper": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/lodash._createwrapper/-/lodash._createwrapper-3.2.0.tgz", - "integrity": "sha512-O8fi7P57KZQjtTJN3tbUAJsm6Coo35JVi4OiEU/WV0rrqaWemk+rRB/1ohiIiv1cIK3dIkVhMehaFOFyNZDYkQ==", - "dev": true, - "dependencies": { - "lodash._root": "^3.0.0" - } - }, - "node_modules/lodash._root": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/lodash._root/-/lodash._root-3.0.1.tgz", - "integrity": "sha512-O0pWuFSK6x4EXhM1dhZ8gchNtG7JMqBtrHdoUFUWXD7dJnNSUze1GuyQr5sOs0aCvgGeI3o/OJW8f4ca7FDxmQ==", - "dev": true - }, "node_modules/lodash.flattendeep": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", @@ -2856,15 +2846,6 @@ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, - "node_modules/lodash.wrap": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/lodash.wrap/-/lodash.wrap-3.0.1.tgz", - "integrity": "sha512-DG1m5ZU7tt5HC1c/UnwhTD3gcjMfAm0JvoamALYZDSxEmQlJrGclclL9nh/WmcthxnfYN53UQa7uKYMvBV+RAg==", - "dev": true, - "dependencies": { - "lodash._createwrapper": "^3.0.0" - } - }, "node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", @@ -3138,19 +3119,6 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, - "node_modules/must": { - "version": "0.13.4", - "resolved": "https://registry.npmjs.org/must/-/must-0.13.4.tgz", - "integrity": "sha512-5RUPT4WINrrzxC0TuOvoBFJocOAaSnhu2r+98GYYGZRcYQla4QZInNVmAnRXtveceibc1RDSP16dwKMnMJhr4Q==", - "dev": true, - "dependencies": { - "egal": ">= 1.3.0 < 2", - "json-stringify-safe": ">= 5 < 6", - "kindof": ">= 2.0.0 < 3", - "lodash.wrap": ">= 3 < 4", - "oolong": ">= 1.11.0 < 2" - } - }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -3378,12 +3346,6 @@ "wrappy": "1" } }, - "node_modules/oolong": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/oolong/-/oolong-1.15.1.tgz", - "integrity": "sha512-I2XTx2/q8CsAXrAnoczmX0uSP5jIh7wQmLnVRcRLynYepaBPQ/p0nGLloO2Q5Lek6T5Gglnkb/SaEYLQrAWR3g==", - "dev": true - }, "node_modules/optionator": { "version": "0.9.4", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", @@ -3595,15 +3557,6 @@ "node": ">=6" } }, - "node_modules/randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, - "dependencies": { - "safe-buffer": "^5.1.0" - } - }, "node_modules/readdirp": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", @@ -3671,26 +3624,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, "node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -3701,12 +3634,12 @@ } }, "node_modules/serialize-javascript": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", - "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-7.1.1.tgz", + "integrity": "sha512-k3CMsaIvvdSwm8oLB4MXSl0wH2/cwlH7xGcnRd2DaeRmBkbzYmyT8j0tsX60DwD1eRwHTpNpH8ljKu9oUT1MeQ==", "dev": true, - "dependencies": { - "randombytes": "^2.1.0" + "engines": { + "node": ">=20.0.0" } }, "node_modules/set-blocking": { @@ -3716,9 +3649,10 @@ "dev": true }, "node_modules/sharp": { - "version": "0.35.3", - "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.35.3.tgz", - "integrity": "sha512-ej0zVHuZGHCiABXcNxeYhpRnPNPAcvbG8RMdBAhDAxLKkCRVSpK3Iyu7qbqw3JMzoj0REeM6f3tJLtVwl0023Q==", + "version": "0.35.4", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.35.4.tgz", + "integrity": "sha512-n++8XWcj+jCOr2IOl7h8LbKnGBDY4aPbmprMONBNFdn0ImXqpGVv5zliDs0V9HbmbCQLpbuo2ej9rAoOQTvMDA==", + "license": "Apache-2.0", "dependencies": { "@img/colour": "^1.1.0", "detect-libc": "^2.1.2", @@ -3731,31 +3665,31 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-darwin-arm64": "0.35.3", - "@img/sharp-darwin-x64": "0.35.3", - "@img/sharp-freebsd-wasm32": "0.35.3", - "@img/sharp-libvips-darwin-arm64": "1.3.2", - "@img/sharp-libvips-darwin-x64": "1.3.2", - "@img/sharp-libvips-linux-arm": "1.3.2", - "@img/sharp-libvips-linux-arm64": "1.3.2", - "@img/sharp-libvips-linux-ppc64": "1.3.2", - "@img/sharp-libvips-linux-riscv64": "1.3.2", - "@img/sharp-libvips-linux-s390x": "1.3.2", - "@img/sharp-libvips-linux-x64": "1.3.2", - "@img/sharp-libvips-linuxmusl-arm64": "1.3.2", - "@img/sharp-libvips-linuxmusl-x64": "1.3.2", - "@img/sharp-linux-arm": "0.35.3", - "@img/sharp-linux-arm64": "0.35.3", - "@img/sharp-linux-ppc64": "0.35.3", - "@img/sharp-linux-riscv64": "0.35.3", - "@img/sharp-linux-s390x": "0.35.3", - "@img/sharp-linux-x64": "0.35.3", - "@img/sharp-linuxmusl-arm64": "0.35.3", - "@img/sharp-linuxmusl-x64": "0.35.3", - "@img/sharp-webcontainers-wasm32": "0.35.3", - "@img/sharp-win32-arm64": "0.35.3", - "@img/sharp-win32-ia32": "0.35.3", - "@img/sharp-win32-x64": "0.35.3" + "@img/sharp-darwin-arm64": "0.35.4", + "@img/sharp-darwin-x64": "0.35.4", + "@img/sharp-freebsd-wasm32": "0.35.4", + "@img/sharp-libvips-darwin-arm64": "1.3.3", + "@img/sharp-libvips-darwin-x64": "1.3.3", + "@img/sharp-libvips-linux-arm": "1.3.3", + "@img/sharp-libvips-linux-arm64": "1.3.3", + "@img/sharp-libvips-linux-ppc64": "1.3.3", + "@img/sharp-libvips-linux-riscv64": "1.3.3", + "@img/sharp-libvips-linux-s390x": "1.3.3", + "@img/sharp-libvips-linux-x64": "1.3.3", + "@img/sharp-libvips-linuxmusl-arm64": "1.3.3", + "@img/sharp-libvips-linuxmusl-x64": "1.3.3", + "@img/sharp-linux-arm": "0.35.4", + "@img/sharp-linux-arm64": "0.35.4", + "@img/sharp-linux-ppc64": "0.35.4", + "@img/sharp-linux-riscv64": "0.35.4", + "@img/sharp-linux-s390x": "0.35.4", + "@img/sharp-linux-x64": "0.35.4", + "@img/sharp-linuxmusl-arm64": "0.35.4", + "@img/sharp-linuxmusl-x64": "0.35.4", + "@img/sharp-webcontainers-wasm32": "0.35.4", + "@img/sharp-win32-arm64": "0.35.4", + "@img/sharp-win32-ia32": "0.35.4", + "@img/sharp-win32-x64": "0.35.4" }, "peerDependenciesMeta": { "@types/node": { @@ -4047,6 +3981,7 @@ "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD", "optional": true }, "node_modules/type-check": { diff --git a/package.json b/package.json index 86982fe..56795ce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sharp-cli", - "version": "6.0.0-dev", + "version": "6.1.0", "description": "CLI for sharp.", "keywords": [ "cli", @@ -16,7 +16,10 @@ "license": "MIT", "type": "module", "author": "Mark van Seventer ", - "repository": "vseventer/sharp-cli", + "repository": { + "type": "git", + "url": "git+https://github.com/vseventer/sharp-cli.git" + }, "bin": { "sharp": "bin/cli.js" }, @@ -30,7 +33,7 @@ }, "dependencies": { "glob": "13.0.x", - "sharp": "0.35.3", + "sharp": "0.35.4", "yargs": "17.7.x" }, "devDependencies": { @@ -40,12 +43,15 @@ "fs-extra": "11.4.x", "globals": "17.11.x", "mocha": "11.8.x", - "must": "0.13.x", "nyc": "18.0.x", "prettier": "3.9.x", "sinon": "22.1.x", "tempy": "3.2.x" }, + "overrides": { + "diff": "8.0.3", + "serialize-javascript": "7.1.1" + }, "engines": { "node": ">=20.10.0" } diff --git a/test/cli.js b/test/cli.js index a09951d..ec9b096 100644 --- a/test/cli.js +++ b/test/cli.js @@ -22,10 +22,10 @@ */ // Standard lib. +import assert from "node:assert/strict"; import { fileURLToPath } from "node:url"; // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -53,12 +53,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the adaptiveFiltering flag", () => { - expect(cli.parsed.argv).to.have.property("adaptiveFiltering", true); + assert.equal(cli.parsed.argv["adaptiveFiltering"], true); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("png"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("png")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -77,12 +77,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the alphaQuality flag", () => { - expect(cli.parsed.argv).to.have.property("alphaQuality", alphaQuality); + assert.equal(cli.parsed.argv["alphaQuality"], alphaQuality); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("webp"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("webp")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -97,7 +97,7 @@ describe(`${pkg.name} [command..]`, () => { it("must set the animated flag", () => { const args = cli.parsed.argv; - expect(args).to.have.property("animated", true); + assert.equal(args["animated"], true); }); it("must set the animated flag when using composite", () => { const pipeline = drain(cli.parsed.argv); @@ -115,7 +115,7 @@ describe(`${pkg.name} [command..]`, () => { it("must set the autoOrient flag", () => { const args = cli.parsed.argv; - expect(args).to.have.property("autoOrient", true); + assert.equal(args["autoOrient"], true); }); it("must set the autoOrient flag when using composite", () => { const pipeline = drain(cli.parsed.argv); @@ -132,12 +132,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the bigtiff flag", () => { - expect(cli.parsed.argv).to.have.property("bigtiff", true); + assert.equal(cli.parsed.argv["bigtiff"], true); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("tiff"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("tiff")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -154,12 +154,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the bitdepth flag", () => { - expect(cli.parsed.argv).to.have.property("bitdepth", bitdepth); + assert.equal(cli.parsed.argv["bitdepth"], bitdepth); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("tiff"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("tiff")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -178,16 +178,13 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the chromaSubsampling flag", () => { - expect(cli.parsed.argv).to.have.property( - "chromaSubsampling", - chromaSubsampling, - ); + assert.equal(cli.parsed.argv["chromaSubsampling"], chromaSubsampling); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(2); - expect(pipeline).to.include("avif"); - expect(pipeline).to.include("jpeg"); + assert.equal(pipeline.length, 2); + assert.ok(pipeline.includes("avif")); + assert.ok(pipeline.includes("jpeg")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -205,13 +202,13 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the colors flag", () => { - expect(cli.parsed.argv).to.have.property("colors", colors); + assert.equal(cli.parsed.argv["colors"], colors); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(2); - expect(pipeline).to.include("gif"); - expect(pipeline).to.include("png"); + assert.equal(pipeline.length, 2); + assert.ok(pipeline.includes("gif")); + assert.ok(pipeline.includes("png")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -229,12 +226,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the compression flag", () => { - expect(cli.parsed.argv).to.have.property("compression", compression); + assert.equal(cli.parsed.argv["compression"], compression); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("tiff"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("tiff")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -252,12 +249,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the compressionLevel flag", () => { - expect(cli.parsed.argv).to.have.property("compressionLevel", level); + assert.equal(cli.parsed.argv["compressionLevel"], level); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("png"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("png")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -277,12 +274,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the delay flag", () => { - expect(cli.parsed.argv).to.have.property("delay", delay); + assert.equal(cli.parsed.argv["delay"], delay); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("gif"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("gif")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -299,7 +296,7 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the density flag", () => { - expect(cli.parsed.argv).to.have.property("density", density); + assert.equal(cli.parsed.argv["density"], density); }); }); @@ -312,13 +309,13 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the dither flag", () => { - expect(cli.parsed.argv).to.have.property("dither", dither); + assert.equal(cli.parsed.argv["dither"], dither); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(2); - expect(pipeline).to.include("gif"); - expect(pipeline).to.include("png"); + assert.equal(pipeline.length, 2); + assert.ok(pipeline.includes("gif")); + assert.ok(pipeline.includes("png")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -333,7 +330,7 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the dry flag", () => { - expect(cli.parsed.argv).to.have.property("dry", true); + assert.equal(cli.parsed.argv["dry"], true); }); }); @@ -346,16 +343,16 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the effort flag", () => { - expect(cli.parsed.argv).to.have.property("effort", effort); + assert.equal(cli.parsed.argv["effort"], effort); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(5); - expect(pipeline).to.include("avif"); - expect(pipeline).to.include("gif"); - expect(pipeline).to.include("heif"); - expect(pipeline).to.include("png"); - expect(pipeline).to.include("webp"); + assert.equal(pipeline.length, 5); + assert.ok(pipeline.includes("avif")); + assert.ok(pipeline.includes("gif")); + assert.ok(pipeline.includes("heif")); + assert.ok(pipeline.includes("png")); + assert.ok(pipeline.includes("webp")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -369,12 +366,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the exact flag", () => { - expect(cli.parsed.argv).to.have.property("exact", true); + assert.equal(cli.parsed.argv["exact"], true); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("webp"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("webp")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -392,7 +389,7 @@ describe(`${pkg.name} [command..]`, () => { it("must set the failOn flag", () => { const args = cli.parsed.argv; - expect(args).to.have.property("failOn", failOn); + assert.equal(args["failOn"], failOn); }); it("must set the failOn flag when using composite", () => { const pipeline = drain(cli.parsed.argv); @@ -413,12 +410,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the format flag", () => { - expect(cli.parsed.argv).to.have.property("format", format); + assert.equal(cli.parsed.argv["format"], format); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("format"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("format")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -428,11 +425,11 @@ describe(`${pkg.name} [command..]`, () => { }); ["h", "help"].forEach((alias) => { describe(`--${alias}`, () => { - it("must display help", async () => { - const output = await cli - .parseAsync([`--${alias}`]) - .catch((output) => output); - expect(output).to.contain("Commands"); + it("must display help", () => { + return assert.rejects(cli.parseAsync([`--${alias}`]), (output) => { + assert.ok(output.includes("Commands")); + return true; + }); }); }); }); @@ -446,12 +443,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the hbitdepth flag", () => { - expect(cli.parsed.argv).to.have.property("hbitdepth", bitdepth); + assert.equal(cli.parsed.argv["hbitdepth"], bitdepth); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("heif"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("heif")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -468,12 +465,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the compression flag", () => { - expect(cli.parsed.argv).to.have.property("hcompression", compression); + assert.equal(cli.parsed.argv["hcompression"], compression); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("heif"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("heif")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -490,18 +487,15 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the input flag", () => { const args = cli.parsed.argv; - expect(args).to.have.property("input"); - expect(args.input).to.eql([input, input]); + assert.ok(Object.prototype.hasOwnProperty.call(args, "input")); + assert.deepEqual(args.input, [input, input]); }); - it("must fail when no input is given", async () => { - const error = await cli - .parseAsync([`--${alias}`, "-o", output]) - .then(() => { - throw new Error("STOP"); - }) - .catch((error) => error); - expect(error.message).to.contain("Not enough arguments"); + it("must fail when no input is given", () => { + return assert.rejects( + cli.parseAsync([`--${alias}`, "-o", output]), + "Not enough arguments", + ); }); }); }); @@ -513,7 +507,7 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the ignoreIcc flag", () => { - expect(cli.parsed.argv).to.have.property("ignoreIcc", true); + assert.equal(cli.parsed.argv["ignoreIcc"], true); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -533,12 +527,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the interFrameMaxError flag", () => { - expect(cli.parsed.argv).to.have.property("interFrameMaxError", max); + assert.equal(cli.parsed.argv["interFrameMaxError"], max); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("gif"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("gif")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -555,12 +549,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the interPaletteMaxError flag", () => { - expect(cli.parsed.argv).to.have.property("interPaletteMaxError", max); + assert.equal(cli.parsed.argv["interPaletteMaxError"], max); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("gif"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("gif")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -576,12 +570,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the keepDuplicateFrames flag", () => { - expect(cli.parsed.argv).to.have.property("keepDuplicateFrames", true); + assert.equal(cli.parsed.argv["keepDuplicateFrames"], true); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("gif"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("gif")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -597,12 +591,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the keepGainMap flag", () => { - expect(cli.parsed.argv).to.have.property("keepGainMap", true); + assert.equal(cli.parsed.argv["keepGainMap"], true); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("keepGainMap"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("keepGainMap")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -619,7 +613,7 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the level flag", () => { - expect(cli.parsed.argv).to.have.property("level", level); + assert.equal(cli.parsed.argv["level"], level); }); }); @@ -639,7 +633,7 @@ describe(`${pkg.name} [command..]`, () => { it("must set the limitInputChannels flag", () => { const args = cli.parsed.argv; - expect(args).to.have.property("limitInputChannels", value); + assert.equal(args["limitInputChannels"], value); }); it("must set the limitInputChannels flag when using composite", () => { const pipeline = drain(cli.parsed.argv); @@ -666,7 +660,7 @@ describe(`${pkg.name} [command..]`, () => { it("must set the limitInputPixels flag", () => { const args = cli.parsed.argv; - expect(args).to.have.property("limitInputPixels", value); + assert.equal(args["limitInputPixels"], value); }); it("must set the limitInputPixels flag when using composite", () => { const pipeline = drain(cli.parsed.argv); @@ -686,12 +680,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the loop flag", () => { - expect(cli.parsed.argv).to.have.property("loop", loop); + assert.equal(cli.parsed.argv["loop"], loop); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("gif"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("gif")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -705,14 +699,14 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the lossless flag", () => { - expect(cli.parsed.argv).to.have.property("lossless", true); + assert.equal(cli.parsed.argv["lossless"], true); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(3); - expect(pipeline).to.include("avif"); - expect(pipeline).to.include("heif"); - expect(pipeline).to.include("webp"); + assert.equal(pipeline.length, 3); + assert.ok(pipeline.includes("avif")); + assert.ok(pipeline.includes("heif")); + assert.ok(pipeline.includes("webp")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -727,12 +721,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the miniswhite flag", () => { - expect(cli.parsed.argv).to.have.property("miniswhite", true); + assert.equal(cli.parsed.argv["miniswhite"], true); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("tiff"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("tiff")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -746,12 +740,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the minSize flag", () => { - expect(cli.parsed.argv).to.have.property("minSize", true); + assert.equal(cli.parsed.argv["minSize"], true); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("webp"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("webp")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -765,12 +759,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the lossless flag", () => { - expect(cli.parsed.argv).to.have.property("mixed", true); + assert.equal(cli.parsed.argv["mixed"], true); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("webp"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("webp")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -784,12 +778,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the mozjpeg flag", () => { - expect(cli.parsed.argv).to.have.property("mozjpeg", true); + assert.equal(cli.parsed.argv["mozjpeg"], true); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("jpeg"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("jpeg")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -803,12 +797,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the nearLossless flag", () => { - expect(cli.parsed.argv).to.have.property("nearLossless", true); + assert.equal(cli.parsed.argv["nearLossless"], true); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("webp"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("webp")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -822,12 +816,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the optimise flag", () => { - expect(cli.parsed.argv).to.have.property("optimise", true); + assert.equal(cli.parsed.argv["optimise"], true); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("jpeg"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("jpeg")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -846,12 +840,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the optimiseScans flag", () => { - expect(cli.parsed.argv).to.have.property("optimiseCoding", false); + assert.equal(cli.parsed.argv["optimiseCoding"], false); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("jpeg"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("jpeg")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -868,14 +862,14 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the optimiseScans flag", () => { - expect(cli.parsed.argv).to.have.property("optimiseScans", true); + assert.equal(cli.parsed.argv["optimiseScans"], true); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(3); - expect(pipeline).to.include("jpeg"); - expect(pipeline).to.include("gif"); // Because: -p. - expect(pipeline).to.include("png"); // Because: -p. + assert.equal(pipeline.length, 3); + assert.ok(pipeline.includes("jpeg")); + assert.ok(pipeline.includes("gif")); // Because: -p. + assert.ok(pipeline.includes("png")); // Because: -p. }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -890,7 +884,7 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the output flag", () => { - expect(cli.parsed.argv).to.have.property("output", output); + assert.equal(cli.parsed.argv["output"], output); }); }); }); @@ -901,12 +895,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the overshootDeringing flag", () => { - expect(cli.parsed.argv).to.have.property("overshootDeringing", true); + assert.equal(cli.parsed.argv["overshootDeringing"], true); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("jpeg"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("jpeg")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -925,7 +919,7 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the page flag", () => { - expect(cli.parsed.argv).to.have.property("page", page); + assert.equal(cli.parsed.argv["page"], page); }); }); @@ -938,7 +932,7 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the pages flag", () => { - expect(cli.parsed.argv).to.have.property("pages", pages); + assert.equal(cli.parsed.argv["pages"], pages); }); }); @@ -948,12 +942,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the palette flag", () => { - expect(cli.parsed.argv).to.have.property("palette", true); + assert.equal(cli.parsed.argv["palette"], true); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("png"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("png")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -977,7 +971,7 @@ describe(`${pkg.name} [command..]`, () => { it("must set the pdfBackground flag", () => { const args = cli.parsed.argv; - expect(args).to.have.property("pdfBackground", value); + assert.equal(args["pdfBackground"], value); }); it("must set the pdfBackground flag when using composite", () => { const pipeline = drain(cli.parsed.argv); @@ -997,12 +991,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the predictor flag", () => { - expect(cli.parsed.argv).to.have.property("predictor", predictor); + assert.equal(cli.parsed.argv["predictor"], predictor); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("tiff"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("tiff")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -1019,12 +1013,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the preset flag", () => { - expect(cli.parsed.argv).to.have.property("preset", preset); + assert.equal(cli.parsed.argv["preset"], preset); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("webp"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("webp")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -1038,7 +1032,7 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the print flag", () => { - expect(cli.parsed.argv).to.have.property("print", true); + assert.equal(cli.parsed.argv["print"], true); }); }); @@ -1048,12 +1042,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the pyramid flag", () => { - expect(cli.parsed.argv).to.have.property("pyramid", true); + assert.equal(cli.parsed.argv["pyramid"], true); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("tiff"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("tiff")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -1068,14 +1062,14 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the format flag", () => { - expect(cli.parsed.argv).to.have.property("progressive", true); + assert.equal(cli.parsed.argv["progressive"], true); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(3); - expect(pipeline).to.include("gif"); - expect(pipeline).to.include("jpeg"); - expect(pipeline).to.include("png"); + assert.equal(pipeline.length, 3); + assert.ok(pipeline.includes("gif")); + assert.ok(pipeline.includes("jpeg")); + assert.ok(pipeline.includes("png")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -1096,16 +1090,16 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the format flag", () => { - expect(cli.parsed.argv).to.have.property("quality", quality); + assert.equal(cli.parsed.argv["quality"], quality); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(5); - expect(pipeline).to.include("avif"); - expect(pipeline).to.include("heif"); - expect(pipeline).to.include("jpeg"); - expect(pipeline).to.include("tiff"); - expect(pipeline).to.include("webp"); + assert.equal(pipeline.length, 5); + assert.ok(pipeline.includes("avif")); + assert.ok(pipeline.includes("heif")); + assert.ok(pipeline.includes("jpeg")); + assert.ok(pipeline.includes("tiff")); + assert.ok(pipeline.includes("webp")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -1143,12 +1137,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the quantisationTable flag", () => { - expect(cli.parsed.argv).to.have.property("quantisationTable", table); + assert.equal(cli.parsed.argv["quantisationTable"], table); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("jpeg"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("jpeg")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -1165,12 +1159,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the reoptimise flag", () => { - expect(cli.parsed.argv).to.have.property("reuse", true); + assert.equal(cli.parsed.argv["reuse"], true); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("gif"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("gif")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -1188,12 +1182,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the resolutionUnit flag", () => { - expect(cli.parsed.argv).to.have.property("resolutionUnit", unit); + assert.equal(cli.parsed.argv["resolutionUnit"], unit); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("tiff"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("tiff")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -1207,12 +1201,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the smartDeblock flag", () => { - expect(cli.parsed.argv).to.have.property("smartDeblock", true); + assert.equal(cli.parsed.argv["smartDeblock"], true); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("webp"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("webp")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -1226,12 +1220,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the smartSubsample flag", () => { - expect(cli.parsed.argv).to.have.property("smartSubsample", true); + assert.equal(cli.parsed.argv["smartSubsample"], true); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("webp"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("webp")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -1248,7 +1242,7 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the subifd flag", () => { - expect(cli.parsed.argv).to.have.property("subifd", subifd); + assert.equal(cli.parsed.argv["subifd"], subifd); }); }); @@ -1263,15 +1257,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the tileBackground flag", () => { - expect(cli.parsed.argv).to.have.property( - "tileBackground", - tileBackground, - ); + assert.equal(cli.parsed.argv["tileBackground"], tileBackground); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("tiff"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("tiff")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -1290,12 +1281,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the tileHeight flag", () => { - expect(cli.parsed.argv).to.have.property("tileHeight", tileHeight); + assert.equal(cli.parsed.argv["tileHeight"], tileHeight); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("tiff"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("tiff")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -1325,12 +1316,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the tileWidth flag", () => { - expect(cli.parsed.argv).to.have.property("tileWidth", tileWidth); + assert.equal(cli.parsed.argv["tileWidth"], tileWidth); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("tiff"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("tiff")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -1348,12 +1339,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the trellisQuantisation flag", () => { - expect(cli.parsed.argv).to.have.property("trellisQuantisation", true); + assert.equal(cli.parsed.argv["trellisQuantisation"], true); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("jpeg"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("jpeg")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -1364,11 +1355,11 @@ describe(`${pkg.name} [command..]`, () => { }); ["v", "version"].forEach((alias) => { describe(`--${alias}`, () => { - it("must display the version number", async () => { - const output = await cli - .parseAsync([`--${alias}`]) - .catch((output) => output); - expect(output).to.equal(pkg.version); + it("must display the version number", () => { + return assert.rejects(cli.parseAsync([`--${alias}`]), (output) => { + assert.equal(output, pkg.version); + return true; + }); }); }); }); @@ -1382,12 +1373,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the timeout flag", () => { - expect(cli.parsed.argv).to.have.property("timeout", timeout); + assert.equal(cli.parsed.argv["timeout"], timeout); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("timeout"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("timeout")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -1404,13 +1395,13 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the tune flag", () => { - expect(cli.parsed.argv).to.have.property("tune", tune); + assert.equal(cli.parsed.argv["tune"], tune); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(2); - expect(pipeline).to.include("avif"); - expect(pipeline).to.include("heif"); + assert.equal(pipeline.length, 2); + assert.ok(pipeline.includes("avif")); + assert.ok(pipeline.includes("heif")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -1425,7 +1416,7 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the unlimited flag", () => { - expect(cli.parsed.argv).to.have.property("unlimited", true); + assert.equal(cli.parsed.argv["unlimited"], true); }); }); @@ -1436,12 +1427,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the withMetadata flag", () => { - expect(cli.parsed.argv).to.have.property("withMetadata", true); + assert.equal(cli.parsed.argv["withMetadata"], true); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("withMetadata"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("withMetadata")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -1459,12 +1450,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the withDensity flag", () => { - expect(cli.parsed.argv).to.have.property("withDensity", density); + assert.equal(cli.parsed.argv["withDensity"], density); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("withDensity"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("withDensity")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -1478,12 +1469,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the withGainMap flag", () => { - expect(cli.parsed.argv).to.have.property("withGainMap", true); + assert.equal(cli.parsed.argv["withGainMap"], true); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("withGainMap"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("withGainMap")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -1500,12 +1491,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the xres flag", () => { - expect(cli.parsed.argv).to.have.property("xres", xRes); + assert.equal(cli.parsed.argv["xres"], xRes); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("tiff"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("tiff")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -1522,12 +1513,12 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must set the yres flag", () => { - expect(cli.parsed.argv).to.have.property("yres", yRes); + assert.equal(cli.parsed.argv["yres"], yRes); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("tiff"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("tiff")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -1543,8 +1534,8 @@ describe(`${pkg.name} [command..]`, () => { // Tests. it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("flip"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("flip")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -1562,7 +1553,7 @@ describe(`${pkg.name} [command..]`, () => { "--format", "jpeg", ]); - expect(getPipeline(cli.parsed.argv)).to.eql([ + assert.deepEqual(getPipeline(cli.parsed.argv), [ "format", "rotate", "resize", @@ -1582,8 +1573,8 @@ describe(`${pkg.name} [command..]`, () => { "--format", "webp", ]); - expect(argv.format).to.equal("webp"); - expect(getPipeline(argv)).to.eql(["format", "rotate", "resize"]); + assert.equal(argv.format, "webp"); + assert.deepEqual(getPipeline(argv), ["format", "rotate", "resize"]); }); it("must apply format-specific options only to the selected format", async () => { diff --git a/test/cmd/channel-manipulation/bandbool.js b/test/cmd/channel-manipulation/bandbool.js index edf0e42..c6dfc7e 100644 --- a/test/cmd/channel-manipulation/bandbool.js +++ b/test/cmd/channel-manipulation/bandbool.js @@ -23,8 +23,10 @@ // @see https://sharp.pixelplumbing.com/api-channel#bandbool +// Standard lib. +import assert from "node:assert/strict"; + // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -45,12 +47,12 @@ export default function register() { // Tests. it("must set the operator flag", () => { - expect(cli.parsed.argv).to.have.property("operator", "and"); + assert.equal(cli.parsed.argv["operator"], "and"); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("bandbool"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("bandbool")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/cmd/channel-manipulation/ensure-alpha.js b/test/cmd/channel-manipulation/ensure-alpha.js index c055fae..a8a84a1 100644 --- a/test/cmd/channel-manipulation/ensure-alpha.js +++ b/test/cmd/channel-manipulation/ensure-alpha.js @@ -23,8 +23,10 @@ // @see https://sharp.pixelplumbing.com/api-channel#ensurealpha +// Standard lib. +import assert from "node:assert/strict"; + // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -47,8 +49,8 @@ export default function register() { // Tests. it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("ensureAlpha"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("ensureAlpha")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -66,12 +68,12 @@ export default function register() { // Tests. it("must set the alpha flag", () => { - expect(cli.parsed.argv).to.have.property("alpha", alpha); + assert.equal(cli.parsed.argv["alpha"], alpha); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("ensureAlpha"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("ensureAlpha")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/cmd/channel-manipulation/extract-channel.js b/test/cmd/channel-manipulation/extract-channel.js index 56a2bdf..d1d8a54 100644 --- a/test/cmd/channel-manipulation/extract-channel.js +++ b/test/cmd/channel-manipulation/extract-channel.js @@ -23,8 +23,10 @@ // @see https://sharp.pixelplumbing.com/api-channel#extractchannel +// Standard lib. +import assert from "node:assert/strict"; + // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -45,12 +47,12 @@ export default function register() { // Tests. it("must set the operator flag", () => { - expect(cli.parsed.argv).to.have.property("channel", "red"); + assert.equal(cli.parsed.argv["channel"], "red"); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("extractChannel"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("extractChannel")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/cmd/channel-manipulation/join-channel.js b/test/cmd/channel-manipulation/join-channel.js index 9f3aec7..d7c68b6 100644 --- a/test/cmd/channel-manipulation/join-channel.js +++ b/test/cmd/channel-manipulation/join-channel.js @@ -24,11 +24,11 @@ // @see https://sharp.pixelplumbing.com/api-channel#bandbool // Standard lib. +import assert from "node:assert/strict"; import path from "node:path"; import { fileURLToPath } from "node:url"; // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -56,16 +56,16 @@ export default function register() { // Tests. it("must set the operator flag", () => { const args = cli.parsed.argv; - expect(args).to.have.property("images"); - expect(args.images).to.eql([ + assert.ok(Object.prototype.hasOwnProperty.call(args, "images")); + assert.deepEqual(args.images, [ path.normalize(input), path.normalize(input), ]); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("joinChannel"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("joinChannel")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/cmd/channel-manipulation/remove-alpha.js b/test/cmd/channel-manipulation/remove-alpha.js index 71e5d35..da852ab 100644 --- a/test/cmd/channel-manipulation/remove-alpha.js +++ b/test/cmd/channel-manipulation/remove-alpha.js @@ -23,8 +23,10 @@ // @see https://sharp.pixelplumbing.com/api-channel#removealpha +// Standard lib. +import assert from "node:assert/strict"; + // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -46,8 +48,8 @@ export default function register() { // Tests. it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("removeAlpha"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("removeAlpha")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/cmd/colour-manipulation/greyscale.js b/test/cmd/colour-manipulation/greyscale.js index e251f9c..948fe44 100644 --- a/test/cmd/colour-manipulation/greyscale.js +++ b/test/cmd/colour-manipulation/greyscale.js @@ -23,8 +23,10 @@ // @see https://sharp.pixelplumbing.com/api-channel#greyscale +// Standard lib. +import assert from "node:assert/strict"; + // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -47,8 +49,8 @@ export default function register() { // Tests. it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("greyscale"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("greyscale")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/cmd/colour-manipulation/pipeline-colourspace.js b/test/cmd/colour-manipulation/pipeline-colourspace.js index 8543087..0b03f34 100644 --- a/test/cmd/colour-manipulation/pipeline-colourspace.js +++ b/test/cmd/colour-manipulation/pipeline-colourspace.js @@ -23,8 +23,10 @@ // @see https://sharp.pixelplumbing.com/api-colour#pipelinecolorspace +// Standard lib. +import assert from "node:assert/strict"; + // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -46,12 +48,12 @@ export default function register() { // Tests. it("must set the colourspace flag", () => { - expect(cli.parsed.argv).to.have.property("colourspace", "srgb"); + assert.equal(cli.parsed.argv["colourspace"], "srgb"); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("pipelineColourspace"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("pipelineColourspace")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/cmd/colour-manipulation/tint.js b/test/cmd/colour-manipulation/tint.js index dc9a38e..1683392 100644 --- a/test/cmd/colour-manipulation/tint.js +++ b/test/cmd/colour-manipulation/tint.js @@ -23,8 +23,10 @@ // @see https://sharp.pixelplumbing.com/api-colour#tint +// Standard lib. +import assert from "node:assert/strict"; + // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -48,12 +50,12 @@ export default function register() { // Tests. it("must set the colourspace flag", () => { - expect(cli.parsed.argv).to.have.property("rgb", rgb); + assert.equal(cli.parsed.argv["rgb"], rgb); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("tint"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("tint")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/cmd/colour-manipulation/tocolourspace.js b/test/cmd/colour-manipulation/tocolourspace.js index 6e2fc0d..1fae7e0 100644 --- a/test/cmd/colour-manipulation/tocolourspace.js +++ b/test/cmd/colour-manipulation/tocolourspace.js @@ -23,8 +23,10 @@ // @see https://sharp.pixelplumbing.com/api-channel#tocolourspace +// Standard lib. +import assert from "node:assert/strict"; + // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -46,12 +48,12 @@ export default function register() { // Tests. it("must set the colourspace flag", () => { - expect(cli.parsed.argv).to.have.property("colourspace", "srgb"); + assert.equal(cli.parsed.argv["colourspace"], "srgb"); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("toColourspace"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("toColourspace")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/cmd/compositing/composite.js b/test/cmd/compositing/composite.js index a9c2b25..b83d245 100644 --- a/test/cmd/compositing/composite.js +++ b/test/cmd/compositing/composite.js @@ -24,11 +24,11 @@ // @see http://sharp.pixelplumbing.com/api-composite#composite // Standard lib. +import assert from "node:assert/strict"; import path from "node:path"; import { fileURLToPath } from "node:url"; // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -55,13 +55,15 @@ export default function register() { // Tests. it("must set the images flag", () => { - expect(cli.parsed.argv).to.have.property("images"); - expect(cli.parsed.argv.images[0]).to.equal(path.normalize(input)); + assert.ok( + Object.prototype.hasOwnProperty.call(cli.parsed.argv, "images"), + ); + assert.equal(cli.parsed.argv.images[0], path.normalize(input)); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("composite"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("composite")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -160,12 +162,12 @@ export default function register() { before(() => cli.parseAsync(["composite", input, "--blend", blend])); it("must set the blend flag", () => { - expect(cli.parsed.argv).to.have.property("blend", blend); + assert.equal(cli.parsed.argv["blend"], blend); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("composite"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("composite")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -200,13 +202,13 @@ export default function register() { describe("--create.width", () => { it("must set the create.width flag", () => { const args = cli.parsed.argv; - expect(args).to.have.property("create"); - expect(args.create).to.have.property("width", width); + assert.ok(Object.prototype.hasOwnProperty.call(args, "create")); + assert.equal(args.create["width"], width); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("composite"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("composite")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -220,13 +222,13 @@ export default function register() { describe("--create.height", () => { it("must set the create.height flag", () => { const args = cli.parsed.argv; - expect(args).to.have.property("create"); - expect(args.create).to.have.property("height", height); + assert.ok(Object.prototype.hasOwnProperty.call(args, "create")); + assert.equal(args.create["height"], height); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("composite"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("composite")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -240,13 +242,13 @@ export default function register() { describe("--create.channels", () => { it("must set the create.channels flag", () => { const args = cli.parsed.argv; - expect(args).to.have.property("create"); - expect(args.create).to.have.property("channels", channels); + assert.ok(Object.prototype.hasOwnProperty.call(args, "create")); + assert.equal(args.create["channels"], channels); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("composite"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("composite")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -260,13 +262,13 @@ export default function register() { describe("--create.background", () => { it("must set the create.background flag", () => { const args = cli.parsed.argv; - expect(args).to.have.property("create"); - expect(args.create).to.have.property("background", background); + assert.ok(Object.prototype.hasOwnProperty.call(args, "create")); + assert.equal(args.create["background"], background); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("composite"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("composite")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -287,12 +289,12 @@ export default function register() { ); it("must set the density flag", () => { - expect(cli.parsed.argv).to.have.property("density", density); + assert.equal(cli.parsed.argv["density"], density); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("composite"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("composite")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -309,12 +311,12 @@ export default function register() { ); it("must set the gravity flag", () => { - expect(cli.parsed.argv).to.have.property("gravity", "centre"); + assert.equal(cli.parsed.argv["gravity"], "centre"); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("composite"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("composite")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -335,12 +337,12 @@ export default function register() { it("must set the left flag", () => { const args = cli.parsed.argv; - expect(args).to.have.property("left", left); + assert.equal(args["left"], left); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("composite"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("composite")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -355,12 +357,12 @@ export default function register() { before(() => cli.parseAsync(["composite", input, "--premultiplied"])); it("must set the premultiplied flag", () => { - expect(cli.parsed.argv).to.have.property("premultiplied", true); + assert.equal(cli.parsed.argv["premultiplied"], true); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("composite"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("composite")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -375,12 +377,12 @@ export default function register() { before(() => cli.parseAsync(["composite", input, "--tile"])); it("must set the tile flag", () => { - expect(cli.parsed.argv).to.have.property("tile", true); + assert.equal(cli.parsed.argv["tile"], true); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("composite"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("composite")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -401,12 +403,12 @@ export default function register() { it("must set the top flag", () => { const args = cli.parsed.argv; - expect(args).to.have.property("top", top); + assert.equal(args["top"], top); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("composite"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("composite")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/cmd/operations/affine.js b/test/cmd/operations/affine.js index 2f7fab8..6cc447c 100644 --- a/test/cmd/operations/affine.js +++ b/test/cmd/operations/affine.js @@ -23,8 +23,10 @@ // @see https://sharp.pixelplumbing.com/api-operation#affine +// Standard lib. +import assert from "node:assert/strict"; + // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -49,13 +51,15 @@ export default function register() { // Tests. it("must set the matrix flag", () => { - expect(cli.parsed.argv).to.have.property("matrix"); - expect(cli.parsed.argv.matrix).to.eql(matrix); + assert.ok( + Object.prototype.hasOwnProperty.call(cli.parsed.argv, "matrix"), + ); + assert.deepEqual(cli.parsed.argv.matrix, matrix); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("affine"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("affine")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -78,12 +82,12 @@ export default function register() { // Tests. it("must set the background flag", () => { - expect(cli.parsed.argv).to.have.property("background", background); + assert.equal(cli.parsed.argv["background"], background); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("affine"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("affine")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -105,12 +109,12 @@ export default function register() { // Tests. it("must set the flat flag", () => { - expect(cli.parsed.argv).to.have.property(alias, value); + assert.equal(cli.parsed.argv[alias], value); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("affine"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("affine")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -132,12 +136,12 @@ export default function register() { // Tests. it("must set the background flag", () => { - expect(cli.parsed.argv).to.have.property("interpolate", interpolator); + assert.equal(cli.parsed.argv["interpolate"], interpolator); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("affine"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("affine")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/cmd/operations/blur.js b/test/cmd/operations/blur.js index 4409ea1..950e8bf 100644 --- a/test/cmd/operations/blur.js +++ b/test/cmd/operations/blur.js @@ -23,8 +23,10 @@ // @see https://sharp.pixelplumbing.com/api-operation#blur +// Standard lib. +import assert from "node:assert/strict"; + // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -51,8 +53,8 @@ export default function register() { // Tests. it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("blur"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("blur")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -69,12 +71,12 @@ export default function register() { // Tests. it("must set the sigma flag", () => { - expect(cli.parsed.argv).to.have.property("sigma", sigma); + assert.equal(cli.parsed.argv["sigma"], sigma); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("blur"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("blur")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -97,12 +99,14 @@ export default function register() { // Tests. it("must set the minAmplitude flag", () => { - expect(cli.parsed.argv).to.have.property("minAmplitude"); + assert.ok( + Object.prototype.hasOwnProperty.call(cli.parsed.argv, "minAmplitude"), + ); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("blur"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("blur")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -127,12 +131,14 @@ export default function register() { // Tests. it("must set the offset flag", () => { - expect(cli.parsed.argv).to.have.property("precision"); + assert.ok( + Object.prototype.hasOwnProperty.call(cli.parsed.argv, "precision"), + ); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("blur"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("blur")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/cmd/operations/boolean.js b/test/cmd/operations/boolean.js index 39c4745..fcec56b 100644 --- a/test/cmd/operations/boolean.js +++ b/test/cmd/operations/boolean.js @@ -24,11 +24,11 @@ // @see https://sharp.pixelplumbing.com/api-operation#boolean // Standard lib. +import assert from "node:assert/strict"; import path from "node:path"; import { fileURLToPath } from "node:url"; // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -56,13 +56,13 @@ export default function register() { // Tests. it("must set the operand and operator flags", () => { const args = cli.parsed.argv; - expect(args).to.have.property("operand", path.normalize(input)); - expect(args).to.have.property("operator", "and"); + assert.equal(args["operand"], path.normalize(input)); + assert.equal(args["operator"], "and"); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("boolean"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("boolean")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/cmd/operations/clahe.js b/test/cmd/operations/clahe.js index 22d0060..df0be5a 100644 --- a/test/cmd/operations/clahe.js +++ b/test/cmd/operations/clahe.js @@ -23,8 +23,10 @@ // @see https://sharp.pixelplumbing.com/api-operation#recomb +// Standard lib. +import assert from "node:assert/strict"; + // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -50,8 +52,8 @@ export default function register() { // Tests. it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("clahe"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("clahe")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -71,12 +73,12 @@ export default function register() { // Tests. it("must set the maxSlope flag", () => { - expect(cli.parsed.argv).to.have.property("maxSlope", slope); + assert.equal(cli.parsed.argv["maxSlope"], slope); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("clahe"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("clahe")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/cmd/operations/convolve.js b/test/cmd/operations/convolve.js index 588ecfe..22ee2f0 100644 --- a/test/cmd/operations/convolve.js +++ b/test/cmd/operations/convolve.js @@ -23,8 +23,10 @@ // @see https://sharp.pixelplumbing.com/api-operation#convolve +// Standard lib. +import assert from "node:assert/strict"; + // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -52,15 +54,15 @@ export default function register() { // Tests. it("must set the width, height, and kernel flags", () => { const args = cli.parsed.argv; - expect(args).to.have.property("width", width); - expect(args).to.have.property("height", height); - expect(args).to.have.property("kernel"); - expect(args.kernel).to.eql(kernel); + assert.equal(args["width"], width); + assert.equal(args["height"], height); + assert.ok(Object.prototype.hasOwnProperty.call(args, "kernel")); + assert.deepEqual(args.kernel, kernel); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("convolve"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("convolve")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -89,12 +91,12 @@ export default function register() { ); it("must set the offset flag", () => { - expect(cli.parsed.argv).to.have.property("offset", offset); + assert.equal(cli.parsed.argv["offset"], offset); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("convolve"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("convolve")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -117,12 +119,12 @@ export default function register() { ); it("must set the scale flag", () => { - expect(cli.parsed.argv).to.have.property("scale", scale); + assert.equal(cli.parsed.argv["scale"], scale); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("convolve"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("convolve")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/cmd/operations/dilate.js b/test/cmd/operations/dilate.js index b3b4b26..bee9b3d 100644 --- a/test/cmd/operations/dilate.js +++ b/test/cmd/operations/dilate.js @@ -23,8 +23,10 @@ // @see https://sharp.pixelplumbing.com/api-operation#dilate +// Standard lib. +import assert from "node:assert/strict"; + // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -45,8 +47,8 @@ export default function register() { it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("dilate"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("dilate")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -60,12 +62,12 @@ export default function register() { before(() => cli.parseAsync(["dilate", width])); it("must set the width flag", () => { - expect(cli.parsed.argv).to.have.property("width", width); + assert.equal(cli.parsed.argv["width"], width); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("dilate"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("dilate")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/cmd/operations/erode.js b/test/cmd/operations/erode.js index fdf0a41..c63d61e 100644 --- a/test/cmd/operations/erode.js +++ b/test/cmd/operations/erode.js @@ -23,8 +23,10 @@ // @see https://sharp.pixelplumbing.com/api-operation#erode +// Standard lib. +import assert from "node:assert/strict"; + // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -45,8 +47,8 @@ export default function register() { it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("erode"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("erode")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -60,12 +62,12 @@ export default function register() { before(() => cli.parseAsync(["erode", width])); it("must set the width flag", () => { - expect(cli.parsed.argv).to.have.property("width", width); + assert.equal(cli.parsed.argv["width"], width); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("erode"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("erode")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/cmd/operations/flatten.js b/test/cmd/operations/flatten.js index baec114..61aa3b3 100644 --- a/test/cmd/operations/flatten.js +++ b/test/cmd/operations/flatten.js @@ -23,8 +23,10 @@ // @see https://sharp.pixelplumbing.com/api-operation#flatten +// Standard lib. +import assert from "node:assert/strict"; + // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -47,8 +49,8 @@ export default function register() { // Tests. it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("flatten"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("flatten")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -65,12 +67,12 @@ export default function register() { // Tests. it("must set the factor flag", () => { - expect(cli.parsed.argv).to.have.property("background", background); + assert.equal(cli.parsed.argv["background"], background); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("flatten"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("flatten")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/cmd/operations/flip.js b/test/cmd/operations/flip.js index bd433d2..209f58d 100644 --- a/test/cmd/operations/flip.js +++ b/test/cmd/operations/flip.js @@ -23,8 +23,10 @@ // @see https://sharp.pixelplumbing.com/api-operation#flip +// Standard lib. +import assert from "node:assert/strict"; + // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -46,8 +48,8 @@ export default function register() { // Tests. it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("flip"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("flip")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/cmd/operations/flop.js b/test/cmd/operations/flop.js index e398d72..a471307 100644 --- a/test/cmd/operations/flop.js +++ b/test/cmd/operations/flop.js @@ -23,8 +23,10 @@ // @see https://sharp.pixelplumbing.com/api-operation#flop +// Standard lib. +import assert from "node:assert/strict"; + // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -46,8 +48,8 @@ export default function register() { // Tests. it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("flop"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("flop")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/cmd/operations/gamma.js b/test/cmd/operations/gamma.js index 67a8948..6b75227 100644 --- a/test/cmd/operations/gamma.js +++ b/test/cmd/operations/gamma.js @@ -23,8 +23,10 @@ // @see https://sharp.pixelplumbing.com/api-operation#gamma +// Standard lib. +import assert from "node:assert/strict"; + // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -47,8 +49,8 @@ export default function register() { // Tests. it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("gamma"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("gamma")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -65,12 +67,12 @@ export default function register() { // Tests. it("must set the gamma flag", () => { - expect(cli.parsed.argv).to.have.property("gamma", gamma); + assert.equal(cli.parsed.argv["gamma"], gamma); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("gamma"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("gamma")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -87,12 +89,12 @@ export default function register() { // Tests. it("must set the gammaOut flag", () => { - expect(cli.parsed.argv).to.have.property("gammaOut", gammaOut); + assert.equal(cli.parsed.argv["gammaOut"], gammaOut); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("gamma"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("gamma")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/cmd/operations/linear.js b/test/cmd/operations/linear.js index f03c898..025b19c 100644 --- a/test/cmd/operations/linear.js +++ b/test/cmd/operations/linear.js @@ -23,8 +23,10 @@ // @see https://sharp.pixelplumbing.com/api-operation#rotate +// Standard lib. +import assert from "node:assert/strict"; + // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -47,8 +49,8 @@ export default function register() { // Tests. it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("linear"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("linear")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -65,13 +67,15 @@ export default function register() { // Tests. it("must set the multiplier flag", () => { - expect(cli.parsed.argv).to.have.property("multiplier"); - expect(cli.parsed.argv.multiplier[0]).to.equal(multiplier); + assert.ok( + Object.prototype.hasOwnProperty.call(cli.parsed.argv, "multiplier"), + ); + assert.equal(cli.parsed.argv.multiplier[0], multiplier); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("linear"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("linear")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -88,13 +92,15 @@ export default function register() { // Tests. it("must set the offset flag", () => { - expect(cli.parsed.argv).to.have.property("offset"); - expect(cli.parsed.argv.offset[0]).to.equal(offset); + assert.ok( + Object.prototype.hasOwnProperty.call(cli.parsed.argv, "offset"), + ); + assert.equal(cli.parsed.argv.offset[0], offset); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("linear"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("linear")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/cmd/operations/median.js b/test/cmd/operations/median.js index 5694e35..9a6d4ae 100644 --- a/test/cmd/operations/median.js +++ b/test/cmd/operations/median.js @@ -23,8 +23,10 @@ // @see https://sharp.pixelplumbing.com/api-operation#median +// Standard lib. +import assert from "node:assert/strict"; + // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -47,8 +49,8 @@ export default function register() { // Tests. it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("median"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("median")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -65,12 +67,12 @@ export default function register() { // Tests. it("must set the size flag", () => { - expect(cli.parsed.argv).to.have.property("size", size); + assert.equal(cli.parsed.argv["size"], size); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("median"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("median")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/cmd/operations/modulate.js b/test/cmd/operations/modulate.js index 3d2057a..79014b8 100644 --- a/test/cmd/operations/modulate.js +++ b/test/cmd/operations/modulate.js @@ -23,8 +23,10 @@ // @see http://sharp.pixelplumbing.com/api-operation#modulate +// Standard lib. +import assert from "node:assert/strict"; + // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -47,8 +49,8 @@ export default function register() { // Tests. it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("modulate"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("modulate")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -65,12 +67,12 @@ export default function register() { before(() => cli.parseAsync(["modulate", `--${option}`, value])); it(`must set the ${option} flag`, () => { - expect(cli.parsed.argv).to.have.property(option, value); + assert.equal(cli.parsed.argv[option], value); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("modulate"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("modulate")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/cmd/operations/negate.js b/test/cmd/operations/negate.js index 63b4e41..00324dc 100644 --- a/test/cmd/operations/negate.js +++ b/test/cmd/operations/negate.js @@ -23,8 +23,10 @@ // @see https://sharp.pixelplumbing.com/api-operation#negate +// Standard lib. +import assert from "node:assert/strict"; + // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -47,8 +49,8 @@ export default function register() { // Tests. it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("negate"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("negate")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -63,12 +65,12 @@ export default function register() { // Tests. it("must set the alpha flag", () => { - expect(cli.parsed.argv).to.have.property("alpha", false); + assert.equal(cli.parsed.argv["alpha"], false); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("negate"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("negate")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/cmd/operations/normalise.js b/test/cmd/operations/normalise.js index 5fce9cb..07e3132 100644 --- a/test/cmd/operations/normalise.js +++ b/test/cmd/operations/normalise.js @@ -23,8 +23,10 @@ // @see https://sharp.pixelplumbing.com/api-operation#normalise +// Standard lib. +import assert from "node:assert/strict"; + // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -48,8 +50,8 @@ export default function register() { // Tests. it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("normalise"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("normalise")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -67,12 +69,12 @@ export default function register() { // Tests. it("must set the lower flag", () => { - expect(cli.parsed.argv).to.have.property("lower", lower); + assert.equal(cli.parsed.argv["lower"], lower); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("normalise"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("normalise")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -89,12 +91,12 @@ export default function register() { // Tests. it("must set the upper flag", () => { - expect(cli.parsed.argv).to.have.property("upper", upper); + assert.equal(cli.parsed.argv["upper"], upper); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("normalise"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("normalise")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/cmd/operations/recomb.js b/test/cmd/operations/recomb.js index beb8008..c74ffda 100644 --- a/test/cmd/operations/recomb.js +++ b/test/cmd/operations/recomb.js @@ -23,8 +23,10 @@ // @see https://sharp.pixelplumbing.com/api-operation#recomb +// Standard lib. +import assert from "node:assert/strict"; + // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -51,13 +53,15 @@ export default function register() { // Tests. it("must set the matrix flag", () => { - expect(cli.parsed.argv).to.have.property("matrix"); - expect(cli.parsed.argv.matrix).to.eql(matrix); + assert.ok( + Object.prototype.hasOwnProperty.call(cli.parsed.argv, "matrix"), + ); + assert.deepEqual(cli.parsed.argv.matrix, matrix); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("recomb"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("recomb")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/cmd/operations/rotate.js b/test/cmd/operations/rotate.js index 10e20b2..ca0f3b6 100644 --- a/test/cmd/operations/rotate.js +++ b/test/cmd/operations/rotate.js @@ -23,8 +23,10 @@ // @see https://sharp.pixelplumbing.com/api-operation#rotate +// Standard lib. +import assert from "node:assert/strict"; + // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -47,8 +49,8 @@ export default function register() { // Tests. it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("rotate"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("rotate")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -65,12 +67,12 @@ export default function register() { // Tests. it("must set the factor flag", () => { - expect(cli.parsed.argv).to.have.property("angle", angle); + assert.equal(cli.parsed.argv["angle"], angle); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("rotate"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("rotate")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -88,12 +90,12 @@ export default function register() { // Tests. it("must set the background flag", () => { - expect(cli.parsed.argv).to.have.property("background", background); + assert.equal(cli.parsed.argv["background"], background); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("rotate"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("rotate")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/cmd/operations/sharpen.js b/test/cmd/operations/sharpen.js index 1315b0e..f9161b4 100644 --- a/test/cmd/operations/sharpen.js +++ b/test/cmd/operations/sharpen.js @@ -23,8 +23,10 @@ // @see https://sharp.pixelplumbing.com/api-operation#sharpen +// Standard lib. +import assert from "node:assert/strict"; + // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -47,8 +49,8 @@ export default function register() { // Tests. it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("sharpen"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("sharpen")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -65,12 +67,12 @@ export default function register() { // Tests. it("must set the sigma flag", () => { - expect(cli.parsed.argv).to.have.property("sigma", sigma); + assert.equal(cli.parsed.argv["sigma"], sigma); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("sharpen"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("sharpen")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -89,12 +91,12 @@ export default function register() { // Tests. it("must set the flat flag", () => { - expect(cli.parsed.argv).to.have.property("m1", flat); + assert.equal(cli.parsed.argv["m1"], flat); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("sharpen"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("sharpen")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -113,12 +115,12 @@ export default function register() { // Tests. it("must set the jagged flag", () => { - expect(cli.parsed.argv).to.have.property("jagged", jagged); + assert.equal(cli.parsed.argv["jagged"], jagged); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("sharpen"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("sharpen")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -137,12 +139,12 @@ export default function register() { // Tests. it("must set the flat flag", () => { - expect(cli.parsed.argv).to.have.property(alias, value); + assert.equal(cli.parsed.argv[alias], value); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("sharpen"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("sharpen")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/cmd/operations/threshold.js b/test/cmd/operations/threshold.js index f2d577f..03cbeea 100644 --- a/test/cmd/operations/threshold.js +++ b/test/cmd/operations/threshold.js @@ -23,8 +23,10 @@ // @see https://sharp.pixelplumbing.com/api-operation#threshold +// Standard lib. +import assert from "node:assert/strict"; + // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -47,8 +49,8 @@ export default function register() { // Tests. it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("threshold"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("threshold")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -65,12 +67,12 @@ export default function register() { // Tests. it("must set the factor flag", () => { - expect(cli.parsed.argv).to.have.property("value", value); + assert.equal(cli.parsed.argv["value"], value); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("threshold"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("threshold")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -84,12 +86,12 @@ export default function register() { before(() => cli.parseAsync(["threshold", `--${alias}`])); it("must set the greyscale flag", () => { - expect(cli.parsed.argv).to.have.property("greyscale", true); + assert.equal(cli.parsed.argv["greyscale"], true); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("threshold"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("threshold")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/cmd/operations/unflatten.js b/test/cmd/operations/unflatten.js index 064f519..d4d5ed0 100644 --- a/test/cmd/operations/unflatten.js +++ b/test/cmd/operations/unflatten.js @@ -23,8 +23,10 @@ // @see https://sharp.pixelplumbing.com/api-operation#unflatten +// Standard lib. +import assert from "node:assert/strict"; + // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -46,8 +48,8 @@ export default function register() { // Tests. it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("unflatten"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("unflatten")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/cmd/output.js b/test/cmd/output.js index 71b211a..f3cabce 100644 --- a/test/cmd/output.js +++ b/test/cmd/output.js @@ -23,8 +23,10 @@ // @see https://sharp.pixelplumbing.com/api-output#tile +// Standard lib. +import assert from "node:assert/strict"; + // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -47,8 +49,8 @@ export default function register() { // Tests. it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("tile"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("tile")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -65,12 +67,12 @@ export default function register() { // Tests. it("must set the size flag", () => { - expect(cli.parsed.argv).to.have.property("size", size); + assert.equal(cli.parsed.argv["size"], size); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("tile"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("tile")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -88,12 +90,12 @@ export default function register() { // Tests. it("must set the angle flag", () => { - expect(cli.parsed.argv).to.have.property("angle", angle); + assert.equal(cli.parsed.argv["angle"], angle); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("tile"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("tile")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -110,12 +112,12 @@ export default function register() { // Tests. it("must set the background flag", () => { - expect(cli.parsed.argv).to.have.property("background", background); + assert.equal(cli.parsed.argv["background"], background); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("tile"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("tile")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -132,12 +134,12 @@ export default function register() { // Tests. it("must set the id flag", () => { - expect(cli.parsed.argv).to.have.property("basename", basename); + assert.equal(cli.parsed.argv["basename"], basename); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("tile"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("tile")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -150,12 +152,12 @@ export default function register() { before(() => cli.parseAsync(["tile", `--${alias}`])); it("must set the center flag", () => { - expect(cli.parsed.argv).to.have.property("center", true); + assert.equal(cli.parsed.argv["center"], true); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("tile"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("tile")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -173,12 +175,12 @@ export default function register() { // Tests. it("must set the container flag", () => { - expect(cli.parsed.argv).to.have.property("container", container); + assert.equal(cli.parsed.argv["container"], container); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("tile"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("tile")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -195,12 +197,12 @@ export default function register() { // Tests. it("must set the depth flag", () => { - expect(cli.parsed.argv).to.have.property("depth", depth); + assert.equal(cli.parsed.argv["depth"], depth); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("tile"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("tile")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -217,12 +219,12 @@ export default function register() { // Tests. it("must set the id flag", () => { - expect(cli.parsed.argv).to.have.property("id", id); + assert.equal(cli.parsed.argv["id"], id); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("tile"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("tile")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -239,12 +241,12 @@ export default function register() { // Tests. it("must set the layout flag", () => { - expect(cli.parsed.argv).to.have.property("layout", layout); + assert.equal(cli.parsed.argv["layout"], layout); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("tile"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("tile")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -261,12 +263,12 @@ export default function register() { // Tests. it("must set the overlap flag", () => { - expect(cli.parsed.argv).to.have.property("overlap", overlap); + assert.equal(cli.parsed.argv["overlap"], overlap); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("tile"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("tile")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -283,12 +285,12 @@ export default function register() { // Tests. it("must set the overlap flag", () => { - expect(cli.parsed.argv).to.have.property("skipBlanks", skip); + assert.equal(cli.parsed.argv["skipBlanks"], skip); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("tile"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("tile")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/cmd/resizing/extend.js b/test/cmd/resizing/extend.js index 5c26f29..dfface2 100644 --- a/test/cmd/resizing/extend.js +++ b/test/cmd/resizing/extend.js @@ -23,8 +23,10 @@ // @see https://sharp.pixelplumbing.com/api-resize#extend +// Standard lib. +import assert from "node:assert/strict"; + // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -53,15 +55,15 @@ export default function register() { // Tests. it("must set the top, bottom, left, and right flags", () => { const args = cli.parsed.argv; - expect(args).to.have.property("top", args.top); - expect(args).to.have.property("bottom", args.bottom); - expect(args).to.have.property("left", args.left); - expect(args).to.have.property("right", args.right); + assert.equal(args["top"], args.top); + assert.equal(args["bottom"], args.bottom); + assert.equal(args["left"], args.left); + assert.equal(args["right"], args.right); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("extend"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("extend")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -94,12 +96,12 @@ export default function register() { // Tests. it("must set the background flag", () => { - expect(cli.parsed.argv).to.have.property("background", background); + assert.equal(cli.parsed.argv["background"], background); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("extend"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("extend")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -126,12 +128,12 @@ export default function register() { // Tests. it("must set the background flag", () => { - expect(cli.parsed.argv).to.have.property("extendWith", mode); + assert.equal(cli.parsed.argv["extendWith"], mode); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("extend"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("extend")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/cmd/resizing/extract.js b/test/cmd/resizing/extract.js index 4dd089e..4e8228b 100644 --- a/test/cmd/resizing/extract.js +++ b/test/cmd/resizing/extract.js @@ -23,8 +23,10 @@ // @see https://sharp.pixelplumbing.com/api-operation#extract +// Standard lib. +import assert from "node:assert/strict"; + // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -53,15 +55,15 @@ export default function register() { // Tests. it("must set the top, left, width, and height flags", () => { const args = cli.parsed.argv; - expect(args).to.have.property("top", top); - expect(args).to.have.property("left", left); - expect(args).to.have.property("width", width); - expect(args).to.have.property("height", height); + assert.equal(args["top"], top); + assert.equal(args["left"], left); + assert.equal(args["width"], width); + assert.equal(args["height"], height); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("extract"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("extract")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/cmd/resizing/resize.js b/test/cmd/resizing/resize.js index 9b8e388..a6677c1 100644 --- a/test/cmd/resizing/resize.js +++ b/test/cmd/resizing/resize.js @@ -23,8 +23,10 @@ // @see https://sharp.pixelplumbing.com/api-resize/ +// Standard lib. +import assert from "node:assert/strict"; + // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -45,13 +47,13 @@ export default function register() { afterEach("sharp", sharp.prototype.reset); describe("..", () => { - it("must prompt an error", async () => { - const error = await new Promise((resolve) => - cli.parseAsync(["resize"], (err) => resolve(err)), + it("must prompt an error", () => { + const promise = new Promise((resolve, reject) => + cli.parseAsync(["resize"], (error) => + error == null ? resolve() : reject(error), + ), ); - expect(error).to.exist(); - expect(error).to.have.property("message"); - expect(error.message).to.contain("one of width and height"); + return assert.rejects(promise, "one of width and height"); }); }); @@ -60,12 +62,12 @@ export default function register() { it("must set the width flag", () => { const args = cli.parsed.argv; - expect(args).to.have.property("width", width); + assert.equal(args["width"], String(width)); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("resize"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("resize")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -78,12 +80,12 @@ export default function register() { it("must set the height flag", () => { const args = cli.parsed.argv; - expect(args).to.have.property("height", height); + assert.equal(args["height"], String(height)); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("resize"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("resize")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -98,13 +100,13 @@ export default function register() { // Tests. it("must set the width and height flags", () => { const args = cli.parsed.argv; - expect(args).to.have.property("width", width); - expect(args).to.have.property("height", height); + assert.equal(args["width"], String(width)); + assert.equal(args["height"], String(height)); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("resize"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("resize")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -112,6 +114,30 @@ export default function register() { }); }); + describe("percentage dimensions", () => { + const metadata = { height: 331, width: 500 }; + + it("must resize width relative to input metadata", async () => { + await cli.parseAsync(["resize", "50%"]); + const pipeline = drain(cli.parsed.argv, { metadata }); + sinon.assert.calledWithMatch(pipeline.resize, 250, null); + }); + + it("must resize width and height relative to input metadata", async () => { + await cli.parseAsync(["resize", "50%", "75%"]); + const pipeline = drain(cli.parsed.argv, { metadata }); + sinon.assert.calledWithMatch(pipeline.resize, 250, 248); + }); + + it("must fail when input metadata is not set", async () => { + await cli.parseAsync(["resize", "50%"]); + assert.throws( + () => drain(cli.parsed.argv), + "metadata is required to resolve percentage", + ); + }); + }); + describe("[options]", () => { // @see https://sharp.pixelplumbing.com/api-resize#resize describe("--background", () => { @@ -125,12 +151,12 @@ export default function register() { // Tests. it("must set the background flag", () => { - expect(cli.parsed.argv).to.have.property("background", background); + assert.equal(cli.parsed.argv["background"], background); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("resize"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("resize")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -150,12 +176,12 @@ export default function register() { ); it("must set the fastShrinkOnLoad flag", () => { - expect(cli.parsed.argv).to.have.property("fastShrinkOnLoad", false); + assert.equal(cli.parsed.argv["fastShrinkOnLoad"], false); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("resize"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("resize")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -176,12 +202,12 @@ export default function register() { before(() => cli.parseAsync(["resize", width, height, "--fit", fit])); it("must set the fit flag", () => { - expect(cli.parsed.argv).to.have.property("fit", fit); + assert.equal(cli.parsed.argv["fit"], fit); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("resize"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("resize")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -204,12 +230,12 @@ export default function register() { ); it("must set the kernel flag", () => { - expect(cli.parsed.argv).to.have.property("kernel", kernel); + assert.equal(cli.parsed.argv["kernel"], kernel); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("resize"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("resize")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -232,12 +258,12 @@ export default function register() { ); it("must set the position flag", () => { - expect(cli.parsed.argv).to.have.property("position", position); + assert.equal(cli.parsed.argv["position"], position); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("resize"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("resize")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -257,12 +283,12 @@ export default function register() { ); it("must set the withoutEnlargement flag", () => { - expect(cli.parsed.argv).to.have.property("withoutEnlargement", true); + assert.equal(cli.parsed.argv["withoutEnlargement"], true); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("resize"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("resize")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -282,12 +308,12 @@ export default function register() { ); it("must set the withoutReduction flag", () => { - expect(cli.parsed.argv).to.have.property("withoutReduction", true); + assert.equal(cli.parsed.argv["withoutReduction"], true); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("resize"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("resize")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/cmd/resizing/trim.js b/test/cmd/resizing/trim.js index a246a9a..d2e8024 100644 --- a/test/cmd/resizing/trim.js +++ b/test/cmd/resizing/trim.js @@ -23,8 +23,10 @@ // @see https://sharp.pixelplumbing.com/api-resize#trim +// Standard lib. +import assert from "node:assert/strict"; + // Package modules. -import expect from "must"; import sinon from "sinon"; // Local modules. @@ -47,8 +49,8 @@ export default function register() { // Tests. it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("trim"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("trim")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -65,12 +67,12 @@ export default function register() { // Tests. it("must set the threshold flag", () => { - expect(cli.parsed.argv).to.have.property("threshold", threshold); + assert.equal(cli.parsed.argv["threshold"], threshold); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("trim"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("trim")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -88,12 +90,12 @@ export default function register() { // Tests. it("must set the factor flag", () => { - expect(cli.parsed.argv).to.have.property("background", background); + assert.equal(cli.parsed.argv["background"], background); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("trim"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("trim")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -107,12 +109,12 @@ export default function register() { // Tests. it("must set the factor flag", () => { - expect(cli.parsed.argv).to.have.property("lineArt", true); + assert.equal(cli.parsed.argv["lineArt"], true); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("trim"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("trim")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); @@ -129,12 +131,12 @@ export default function register() { // Tests. it("must set the margin flag", () => { - expect(cli.parsed.argv).to.have.property("margin", margin); + assert.equal(cli.parsed.argv["margin"], margin); }); it("must update the pipeline", () => { const pipeline = getPipeline(cli.parsed.argv); - expect(pipeline).to.have.length(1); - expect(pipeline).to.include("trim"); + assert.equal(pipeline.length, 1); + assert.ok(pipeline.includes("trim")); }); it("must execute the pipeline", () => { const pipeline = drain(cli.parsed.argv); diff --git a/test/convert.js b/test/convert.js index aa5dbd9..d918a72 100644 --- a/test/convert.js +++ b/test/convert.js @@ -22,12 +22,12 @@ */ // Standard lib. +import assert from "node:assert/strict"; import path from "node:path"; import { Readable, Writable } from "node:stream"; import { fileURLToPath } from "node:url"; // Package modules. -import expect from "must"; import fs from "fs-extra"; import { temporaryDirectory, temporaryFile } from "tempy"; @@ -40,7 +40,7 @@ describe("convert", () => { const options = { sequentialRead: false }; const createContext = () => ({ options, queue: [] }); const getValue = (result) => { - expect(result.status).to.equal("fulfilled"); + assert.equal(result.status, "fulfilled"); return result.value; }; @@ -66,7 +66,7 @@ describe("convert", () => { return convert .files([input], dest, createContext()) .then(([result]) => - expect(fs.existsSync(getValue(result).output.path)).to.be.true(), + assert.equal(fs.existsSync(getValue(result).output.path), true), ); }); it("must convert a file formatted based on extension", () => { @@ -74,9 +74,9 @@ describe("convert", () => { .files([input], path.join(dest, "{name}.avif"), createContext()) .then(([result]) => { const info = getValue(result); - expect(info.output).to.have.property("format", "heif"); - expect(info.output).to.have.property("path"); - expect(info.output.path).to.contain(".avif"); + assert.equal(info.output["format"], "heif"); + assert.ok(Object.prototype.hasOwnProperty.call(info.output, "path")); + assert.ok(info.output.path.includes(".avif")); }); }); it("must not write a file during a dry run", () => { @@ -84,10 +84,10 @@ describe("convert", () => { const context = { ...createContext(), dry: true }; return convert.files([input], dryDest, context).then(([result]) => { const info = getValue(result); - expect(info.output).to.have.property("format", "jpeg"); - expect(info.output).to.have.property("size"); - expect(info.output.path).to.equal(dryDest); - expect(fs.existsSync(dryDest)).to.be.false(); + assert.equal(info.output["format"], "jpeg"); + assert.ok(Object.prototype.hasOwnProperty.call(info.output, "size")); + assert.equal(info.output.path, dryDest); + assert.equal(fs.existsSync(dryDest), false); }); }); it("must return input and output metadata", () => { @@ -95,18 +95,18 @@ describe("convert", () => { const context = { ...createContext(), dry: true, print: true }; return convert.files([input], output, context).then(([result]) => { const info = getValue(result); - expect(info.input).to.have.property("format", "jpeg"); - expect(info.input.path).to.equal(input); - expect(info.output).to.have.property("format", "jpeg"); - expect(info.output.path).to.equal(output); + assert.equal(info.input["format"], "jpeg"); + assert.equal(info.input.path, input); + assert.equal(info.output["format"], "jpeg"); + assert.equal(info.output.path, output); }); }); it("must return metadata for each file in a batch", () => { const context = { ...createContext(), dry: true, print: true }; return convert.files([input, input], dest, context).then((info) => { - expect(info).to.have.length(2); - expect(getValue(info[0]).input).to.have.property("format", "jpeg"); - expect(getValue(info[0]).output).to.have.property("format", "jpeg"); + assert.equal(info.length, 2); + assert.equal(getValue(info[0]).input["format"], "jpeg"); + assert.equal(getValue(info[0]).output["format"], "jpeg"); }); }); it("must pass the output extension format to queued handlers", () => { @@ -121,33 +121,43 @@ describe("convert", () => { ]); return convert .files([input], path.join(dest, "{name}.avif"), context) - .then(() => expect(format).to.equal("avif")); + .then(() => assert.equal(format, "avif")); }); it("must report a file conversion error", () => { - // Negative test for directory that does not exist. - const rand = "" + Math.random(); + // Negative test for a parent path that is a file. + const output = path.join(copy, "output"); return convert - .files([input, input], rand, createContext()) + .files([input, input], output, createContext()) .then(([result]) => { - expect(result.status).to.equal("rejected"); - expect(result.reason).to.have.property("message"); - expect(result.reason.message).to.contain(`${rand}/input.jpg`); - expect(result.reason.message).to.contain("No such file or directory"); + assert.equal(result.status, "rejected"); + assert.equal(result.reason.code, "ENOTDIR"); }); }); it("must convert multiple files", () => { return convert .files([input, input], dest, createContext()) - .then((info) => expect(info).to.have.length(2)); + .then((info) => assert.equal(info.length, 2)); }); it("must support output templates", () => { const rand = Math.random(); return convert .files([input], path.join(dest, `{name}-${rand}{ext}`), createContext()) .then(([result]) => - expect(getValue(result).output.path).to.contain(`input-${rand}.jpg`), + assert.ok(getValue(result).output.path.includes(`input-${rand}.jpg`)), ); }); + it("must support relative path output templates", async () => { + const testDir = path.dirname(path.dirname(input)); + const results = await convert.files( + [path.join(testDir, "**", "*.jpg")], + path.join(dest, "{path}", "{base}"), + createContext(), + ); + const [result] = results; + const outputPath = getValue(result).output.path; + assert.equal(outputPath, path.join(dest, "fixtures", "input.jpg")); + assert.equal(fs.existsSync(outputPath), true); + }); it("must allow the same file as input and output", () => { return convert.files([copy], path.dirname(copy), createContext()); }); @@ -157,16 +167,7 @@ describe("convert", () => { return convert.files([input], dest, context); }); it("must warn if there is no files", () => { - return convert - .files([]) - .then(() => { - throw new Error("STOP"); - }) - .catch((err) => { - expect(err).to.exist(); - expect(err).to.have.property("message"); - expect(err.message).to.contain("No input files"); - }); + return assert.rejects(convert.files([]), { message: "No input files" }); }); }); describe("stream", () => { @@ -186,25 +187,20 @@ describe("convert", () => { createContext(), ) .then((info) => { - expect(info.output.format).to.exist(); - expect(info.output.path).to.equal("stdout"); - expect(fs.existsSync(dest)).to.be.true(); + assert.ok(info.output.format != null); + assert.equal(info.output.path, "stdout"); + assert.equal(fs.existsSync(dest), true); }); }); it("must reject stream errors", () => { - return convert - .stream( + return assert.rejects( + convert.stream( Readable.from(["not an image"]), fs.createWriteStream(dest), createContext(), - ) - .then(() => { - throw new Error("STOP"); - }) - .catch((err) => { - expect(err).to.exist(); - expect(err.message).to.contain("unsupported image format"); - }); + ), + "unsupported image format", + ); }); it("must reject output stream errors", () => { @@ -214,12 +210,17 @@ describe("convert", () => { callback(error); }, }); - return convert - .stream(fs.createReadStream(input), failingOutput, createContext()) - .then(() => { - throw new Error("STOP"); - }) - .catch((err) => expect(err).to.equal(error)); + return assert.rejects( + convert.stream( + fs.createReadStream(input), + failingOutput, + createContext(), + ), + (err) => { + assert.equal(err, error); + return true; + }, + ); }); it("must not write to the output stream during a dry run", () => { const failingOutput = new Writable({ @@ -233,8 +234,8 @@ describe("convert", () => { dry: true, }) .then((info) => { - expect(info.output).to.have.property("format", "jpeg"); - expect(info.output).to.have.property("size"); + assert.equal(info.output["format"], "jpeg"); + assert.ok(Object.prototype.hasOwnProperty.call(info.output, "size")); }); }); it("must return input and output metadata", () => { @@ -250,8 +251,8 @@ describe("convert", () => { context, ) .then((info) => { - expect(info.input).to.have.property("format", "jpeg"); - expect(info.output).to.have.property("format", "jpeg"); + assert.equal(info.input["format"], "jpeg"); + assert.equal(info.output["format"], "jpeg"); }); }); }); diff --git a/test/index.js b/test/index.js index 2280d17..04a20ea 100644 --- a/test/index.js +++ b/test/index.js @@ -22,11 +22,11 @@ */ // Standard lib. +import assert from "node:assert/strict"; import path from "node:path"; import { fileURLToPath } from "node:url"; // Package modules. -import expect from "must"; import fs from "fs-extra"; import sinon from "sinon"; import { temporaryDirectory } from "tempy"; @@ -76,7 +76,7 @@ describe("CLI", () => { ], { logger }, ).then(() => { - expect(fs.existsSync(dest)).to.be.true(); + assert.equal(fs.existsSync(dest), true); sinon.assert.calledWithMatch(logger.log, dest); sinon.assert.notCalled(logger.error); }); @@ -85,7 +85,7 @@ describe("CLI", () => { return cli(["-v"], { logger }).then(() => { sinon.assert.calledWith(logger.log, pkg.version); sinon.assert.notCalled(logger.error); - expect(process.exitCode).not.to.equal(1); + assert.notEqual(process.exitCode, 1); }); }); it("must print metadata", () => { @@ -93,8 +93,8 @@ describe("CLI", () => { logger, }).then(() => { const [metadata] = JSON.parse(logger.log.firstCall.args[0]); - expect(metadata.input).to.have.property("format", "jpeg"); - expect(metadata.output).to.have.property("width", 100); + assert.equal(metadata.input["format"], "jpeg"); + assert.equal(metadata.output["width"], 100); sinon.assert.notCalled(logger.error); }); }); @@ -107,12 +107,12 @@ describe("CLI", () => { ) .then(() => { const output = JSON.parse(logger.log.firstCall.args[0]); - expect(output).to.have.length(2); - expect(output[0]).to.have.property("input"); - expect(output[0]).to.have.property("output"); - expect(output[1]).to.have.property("error"); + assert.equal(output.length, 2); + assert.ok(Object.prototype.hasOwnProperty.call(output[0], "input")); + assert.ok(Object.prototype.hasOwnProperty.call(output[0], "output")); + assert.ok(Object.prototype.hasOwnProperty.call(output[1], "error")); sinon.assert.notCalled(logger.error); - expect(process.exitCode).to.equal(1); + assert.equal(process.exitCode, 1); }); }); it("must report partial batch failures", () => { @@ -123,7 +123,7 @@ describe("CLI", () => { .then(() => { sinon.assert.calledWithMatch(logger.log, path.join(dest, "input.jpg")); sinon.assert.calledWithMatch(logger.error, "FAILED:"); - expect(process.exitCode).to.equal(1); + assert.equal(process.exitCode, 1); }); }); it("must display errors", () => { @@ -134,7 +134,16 @@ describe("CLI", () => { logger.error, "Specify --help for available options", ); - expect(process.exitCode).to.equal(1); + assert.equal(process.exitCode, 1); + }); + }); + it("must error when options are incomplete", () => { + return cli(["-i", input, "-o", dest, "--density"], { logger }).then(() => { + sinon.assert.notCalled(logger.log); + sinon.assert.calledWith( + logger.error, + "Not enough arguments following: density", + ); }); }); }); diff --git a/test/utils.js b/test/utils.js index dc5464e..929fd81 100644 --- a/test/utils.js +++ b/test/utils.js @@ -21,8 +21,8 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -// Package modules. -import expect from "must"; +// Standard lib. +import assert from "node:assert/strict"; // Local modules. import { isDirectory, pick } from "../lib/utils.js"; @@ -31,22 +31,22 @@ import { isDirectory, pick } from "../lib/utils.js"; describe("utils", () => { describe("isDirectory", () => { it("must identify directories", () => { - expect(isDirectory(new URL(".", import.meta.url))).to.be.true(); + assert.equal(isDirectory(new URL(".", import.meta.url)), true); }); it("must return false for missing paths", () => { - expect(isDirectory(new URL("./missing", import.meta.url))).to.be.false(); + assert.equal(isDirectory(new URL("./missing", import.meta.url)), false); }); }); describe("pick", () => { it("must pick own properties, including falsy values", () => { const input = { falseValue: false, nullValue: null, zero: 0 }; - expect(pick(input, ["falseValue", "nullValue", "zero"])).to.eql(input); + assert.deepEqual(pick(input, ["falseValue", "nullValue", "zero"]), input); }); it("must omit missing properties", () => { - expect(pick({ value: 1 }, ["missing"])).to.eql({}); + assert.deepEqual(pick({ value: 1 }, ["missing"]), {}); }); }); });