From 10a9045469115fcdc52ef05fbc84c1863677873c Mon Sep 17 00:00:00 2001 From: make-github-pseudonymous-again <5165674+make-github-pseudonymous-again@users.noreply.github.com> Date: Thu, 7 Mar 2024 01:43:58 +0100 Subject: [PATCH] :test_tube: test: Allow CommonJS tests to run. --- src/index.js | 3 +++ test/src/_fixtures.js | 3 +++ test/src/heapq.js | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 test/src/_fixtures.js diff --git a/src/index.js b/src/index.js index 0d8c7a0..746fb38 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,7 @@ +export {IndexError} from '@failure-abstraction/error'; + export * as core from './core/index.js'; + export {default as heappop} from './heappop.js'; export {default as heapify} from './heapify.js'; export {default as heappushpop} from './heappushpop.js'; diff --git a/test/src/_fixtures.js b/test/src/_fixtures.js new file mode 100644 index 0000000..3fe600b --- /dev/null +++ b/test/src/_fixtures.js @@ -0,0 +1,3 @@ +import * as mod from '#module'; + +export const {IndexError} = mod.default ?? mod; diff --git a/test/src/heapq.js b/test/src/heapq.js index c8314ef..139f73e 100644 --- a/test/src/heapq.js +++ b/test/src/heapq.js @@ -1,9 +1,10 @@ import test from 'ava'; -import {IndexError} from '@failure-abstraction/error'; import {list} from '@iterable-iterator/list'; import {increasing} from '@total-order/primitive'; +import {IndexError} from './_fixtures.js'; + import * as heapq from '#module'; test('heapq', (t) => {