From de0b85d81e6392597a35196bde523b9642d7e016 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 5 Sep 2023 20:09:03 -0300 Subject: test: update snapshot tests to always mock image dependency --- test/snapshot/generateCoverArtwork.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'test/snapshot/generateCoverArtwork.js') diff --git a/test/snapshot/generateCoverArtwork.js b/test/snapshot/generateCoverArtwork.js index 21c91454..e35dd8d0 100644 --- a/test/snapshot/generateCoverArtwork.js +++ b/test/snapshot/generateCoverArtwork.js @@ -2,11 +2,11 @@ import t from 'tap'; import {testContentFunctions} from '#test-lib'; testContentFunctions(t, 'generateCoverArtwork (snapshot)', async (t, evaluate) => { - await evaluate.load(); - - const extraDependencies = { - getSizeOfImageFile: () => 0, - }; + await evaluate.load({ + mock: { + image: evaluate.stubContentFunction('image', {mock: true}), + }, + }); const artTags = [ {name: 'Damara', directory: 'damara', isContentWarning: false}, @@ -21,13 +21,11 @@ testContentFunctions(t, 'generateCoverArtwork (snapshot)', async (t, evaluate) = name: 'generateCoverArtwork', args: [artTags], slots: {path, mode: 'primary'}, - extraDependencies, }); evaluate.snapshot('display: thumbnail', { name: 'generateCoverArtwork', args: [artTags], slots: {path, mode: 'thumbnail'}, - extraDependencies, }); }); -- cgit 1.3.0-6-gf8a5