Skip to content

Commit

Permalink
just for funsies, adding legacy libheif js tests, for overkill backwa…
Browse files Browse the repository at this point in the history
…rds compatibility
  • Loading branch information
catdad committed Nov 28, 2023
1 parent 6f7e5c0 commit 4bc3851
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion test/index.test.js
Original file line number Diff line number Diff line change
@@ -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);
});

0 comments on commit 4bc3851

Please sign in to comment.