« get me outta code hell

test: update snapshot tests to always mock image dependency - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/test/snapshot/generateAlbumCoverArtwork.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-09-05 20:09:03 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-09-05 20:11:18 -0300
commitde0b85d81e6392597a35196bde523b9642d7e016 (patch)
tree1b91f7cf89ac81c56a93a5f759578d745f8ea74b /test/snapshot/generateAlbumCoverArtwork.js
parentae1131e54280da63a678eb3489b02a9fb292ee8b (diff)
test: update snapshot tests to always mock image dependency
Diffstat (limited to 'test/snapshot/generateAlbumCoverArtwork.js')
-rw-r--r--test/snapshot/generateAlbumCoverArtwork.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/snapshot/generateAlbumCoverArtwork.js b/test/snapshot/generateAlbumCoverArtwork.js
index 98632d3..b1c7885 100644
--- a/test/snapshot/generateAlbumCoverArtwork.js
+++ b/test/snapshot/generateAlbumCoverArtwork.js
@@ -1,12 +1,14 @@
 import t from 'tap';
+
+import contentFunction from '#content-function';
 import {testContentFunctions} from '#test-lib';
 
 testContentFunctions(t, 'generateAlbumCoverArtwork (snapshot)', async (t, evaluate) => {
-  await evaluate.load();
-
-  const extraDependencies = {
-    getSizeOfImageFile: () => 0,
-  };
+  await evaluate.load({
+    mock: {
+      image: evaluate.stubContentFunction('image'),
+    },
+  });
 
   const album = {
     directory: 'bee-forus-seatbelt-safebee',
@@ -23,13 +25,11 @@ testContentFunctions(t, 'generateAlbumCoverArtwork (snapshot)', async (t, evalua
     name: 'generateAlbumCoverArtwork',
     args: [album],
     slots: {mode: 'primary'},
-    extraDependencies,
   });
 
   evaluate.snapshot('display: thumbnail', {
     name: 'generateAlbumCoverArtwork',
     args: [album],
     slots: {mode: 'thumbnail'},
-    extraDependencies,
   });
 });