diff --git a/package.json b/package.json index 6386869..bad76e2 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,6 @@ "@11ty/eleventy-plugin-webc": "^0.11.2", "ava": "^6.1.2", "eslint": "^8.56.0", - "fs-extra": "^11.2.0", "pixelmatch": "^5.3.0" }, "ava": { diff --git a/test/test.js b/test/test.js index 58c1829..7667399 100644 --- a/test/test.js +++ b/test/test.js @@ -1,6 +1,6 @@ const path = require("path"); const test = require("ava"); -const fs = require("fs-extra"); +const fs = require("fs"); const { URL } = require("url"); const eleventyImage = require("../"); const sharp = require("sharp"); @@ -526,32 +526,36 @@ test("Keep a cache, don’t reuse with same file names and different options", a }); test("Keep a cache, don’t reuse with if the image changes, check promise equality", async t => { - fs.copySync("./test/modify-bio-original.jpg", "./test/generated-modify-bio.jpg"); + fs.copyFileSync("./test/modify-bio-original.jpg", "./test/generated-modify-bio.jpg"); let promise1 = eleventyImage("./test/generated-modify-bio.jpg", { - outputDir: "./test/img/" + outputDir: "./test/img/", + dryRun: true, }); - fs.copySync("./test/modify-bio-grayscale.jpg", "./test/generated-modify-bio.jpg"); + fs.copyFileSync("./test/modify-bio-grayscale.jpg", "./test/generated-modify-bio.jpg"); let promise2 = eleventyImage("./test/generated-modify-bio.jpg", { - outputDir: "./test/img/" + outputDir: "./test/img/", + dryRun: true, }); t.not(promise1, promise2); }); test("Keep a cache, don’t reuse with if the image changes, check output", async t => { - fs.copySync("./test/modify2-bio-original.jpg", "./test/generated-modify2-bio.jpg"); + fs.copyFileSync("./test/modify2-bio-original.jpg", "./test/generated-modify2-bio.jpg"); let stats1 = await eleventyImage("./test/generated-modify2-bio.jpg", { - outputDir: "./test/img/" + outputDir: "./test/img/", + dryRun: true }); - fs.copySync("./test/modify2-bio-grayscale.jpg", "./test/generated-modify2-bio.jpg"); + fs.copyFileSync("./test/modify2-bio-grayscale.jpg", "./test/generated-modify2-bio.jpg"); let stats2 = await eleventyImage("./test/generated-modify2-bio.jpg", { - outputDir: "./test/img/" + outputDir: "./test/img/", + dryRun: true }); t.notDeepEqual(stats1, stats2);