From 4bc385162a667cf21c9281f23e37943cdbb8c793 Mon Sep 17 00:00:00 2001 From: Kiril Vatev Date: Tue, 28 Nov 2023 02:56:25 -0500 Subject: [PATCH] just for funsies, adding legacy libheif js tests, for overkill backwards compatibility --- test/index.test.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/test/index.test.js b/test/index.test.js index c17bdef..ac0b207 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -1,5 +1,22 @@ const runTests = require('./run-tests.js'); -describe('heic-convert (default wasm)', () => { +describe('heic-convert (default wasm libheif)', () => { runTests(require('..')); }); + +// I wouldn't say these are strictly required, but 🤷‍♀️ +describe('heic-convert (legacy js libheif)', () => { + const libheif = require('libheif-js/index.js'); + const decodeLib = require('heic-decode/lib.js'); + const formats = require('../formats-node.js'); + + const { one: decodeOne, all: decodeAll } = decodeLib(libheif); + decodeOne.all = decodeAll; + + const { one, all } = require('../lib.js')(decodeOne, formats); + + const convert = one; + convert.all = all; + + runTests(convert); +});