Skip to content

Commit

Permalink
🧪 test: Make tests work for cjs dist.
Browse files Browse the repository at this point in the history
  • Loading branch information
make-github-pseudonymous-again committed Oct 11, 2022
1 parent 514c1bd commit 45ba34d
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions test/src/error.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import test from 'ava';

import {
CodecError,
EncodeError,
DecodeError,
TranslateError,
} from '#module';
import {ValueError} from './_fixtures.js';
import {CodecError, EncodeError, DecodeError, TranslateError} from '#module';

function macro(t, MyCodecError) {
const encoding = Math.random().toString();
Expand All @@ -32,9 +27,9 @@ function macro(t, MyCodecError) {
t.is(myerror.position, position);
}

macro.title = (_, MyCodecError) => `${MyCodecError}`;
macro.title = (title, MyCodecError) => title ?? MyCodecError.name;

test(macro, CodecError);
test(macro, EncodeError);
test(macro, DecodeError);
test(macro, TranslateError);
test('CodecError', macro, CodecError);
test('EncodeError', macro, EncodeError);
test('DecodeError', macro, DecodeError);
test('TranslateError', macro, TranslateError);

0 comments on commit 45ba34d

Please sign in to comment.