From c6f1011722dc6fe50afb3a63ee414c70dbfd6abf Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Mon, 27 Mar 2023 12:47:04 -0300 Subject: data steps: basic custom mocking function support I checked out a few libraries but none really behaved the way I needed, and coding it myself means much lower- level access, which makes certain options a lot easier (e.g. excluding one argument of a mocked function from assertion while matching the rest against a pattern). --- test/snapshot/linkArtist.js | 5 +++-- test/snapshot/linkTemplate.js | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'test/snapshot') diff --git a/test/snapshot/linkArtist.js b/test/snapshot/linkArtist.js index 383dcab2..633e2ae6 100644 --- a/test/snapshot/linkArtist.js +++ b/test/snapshot/linkArtist.js @@ -1,8 +1,9 @@ import t from 'tap'; - import {testContentFunctions} from '../lib/content-function.js'; -testContentFunctions(t, 'linkArtist', (t, evaluate) => { +testContentFunctions(t, 'linkArtist', async (t, evaluate) => { + await evaluate.load(); + evaluate.snapshot({ name: 'linkArtist', args: [ diff --git a/test/snapshot/linkTemplate.js b/test/snapshot/linkTemplate.js index 6a629682..10321897 100644 --- a/test/snapshot/linkTemplate.js +++ b/test/snapshot/linkTemplate.js @@ -1,8 +1,9 @@ import t from 'tap'; - import {testContentFunctions} from '../lib/content-function.js'; -testContentFunctions(t, 'linkTemplate', (t, evaluate) => { +testContentFunctions(t, 'linkTemplate', async (t, evaluate) => { + await evaluate.load(); + evaluate.snapshot({ name: 'linkTemplate', extraDependencies: { -- cgit 1.3.0-6-gf8a5