Skip to content

Commit 5b7be4b

Browse files
committed
test: fix two type errors
Mentioned in last commit.
1 parent 0620011 commit 5b7be4b

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

packages/legacy/src/lexer/__tests__/Lexer-test.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,12 @@ describe('Lexer()', () => {
480480
lexer.lex('foo').next();
481481

482482
expect(onMatch.mock.calls.length).toBe(1);
483-
expect(onMatch.mock.calls[0][0][0]).toBe('foo');
483+
const array = onMatch.mock.calls[0][0];
484+
if (Array.isArray(array)) {
485+
expect(array[0]).toBe('foo');
486+
} else {
487+
throw new Error('expected Array');
488+
}
484489
expect(onMatch.mock.calls[0][1]).toBe(meta);
485490
});
486491

packages/lexer/src/RegExp/__tests__/normalizeCharacterClass-test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {describe, expect, fail, it} from '@jest/globals';
1+
import {describe, expect, it} from '@jest/globals';
22

33
import RegExpParser from '../RegExpParser';
44
import normalizeCharacterClass from '../normalizeCharacterClass';
@@ -159,7 +159,7 @@ describe('normalizeCharacterClass()', () => {
159159

160160
function assertCharacterClass(node: Node): asserts node is CharacterClass {
161161
if (node.kind !== 'CharacterClass') {
162-
fail('Needed CharacterClass');
162+
throw new Error('Needed CharacterClass');
163163
}
164164
}
165165

0 commit comments

Comments
 (0)