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/transformContent.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'test/snapshot/transformContent.js') diff --git a/test/snapshot/transformContent.js b/test/snapshot/transformContent.js index 25952856..b05beac1 100644 --- a/test/snapshot/transformContent.js +++ b/test/snapshot/transformContent.js @@ -2,7 +2,11 @@ import t from 'tap'; import {testContentFunctions} from '#test-lib'; testContentFunctions(t, 'transformContent (snapshot)', async (t, evaluate) => { - await evaluate.load(); + await evaluate.load({ + mock: { + image: evaluate.stubContentFunction('image'), + }, + }); const extraDependencies = { wikiData: { @@ -11,8 +15,6 @@ testContentFunctions(t, 'transformContent (snapshot)', async (t, evaluate) => { ], }, - getSizeOfImageFile: () => 0, - to: (key, ...args) => `to-${key}/${args.join('/')}`, }; @@ -50,15 +52,18 @@ testContentFunctions(t, 'transformContent (snapshot)', async (t, evaluate) => { quickSnapshot( 'non-inline image #2', - `Rad.\n`); + `Rad.\n` + + ``); quickSnapshot( 'non-inline image #3', - `\nBaller.`); + `\n` + + `Baller.`); quickSnapshot( 'dates', - `[[date:2023-04-13]] Yep!\nVery nice: [[date:25 October 2413]]`); + `[[date:2023-04-13]] Yep!\n` + + `Very nice: [[date:25 October 2413]]`); quickSnapshot( 'super basic string', -- cgit 1.3.0-6-gf8a5