Skip to content

Commit aa31622

Browse files
committed
chore: fix some TypeScript warnings in the unit tests
1 parent 0efaddc commit aa31622

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/compile.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ describe('error handling', () => {
7474
test('should throw a helpful error when passing an object {...} instead of function ["object", {...}]', () => {
7575
let actualErr = undefined
7676
const user = { name: 'Joe' }
77-
const query = { name: ['get', 'name'] }
77+
const query: JSONQuery = { name: ['get', 'name'] }
7878
try {
7979
go(user, query)
8080
} catch (err) {
@@ -94,7 +94,7 @@ describe('error handling', () => {
9494
{ name: 'Joe', age: 32, scores: [6.1, 8.1] }
9595
]
9696
}
97-
const query = [
97+
const query: JSONQuery = [
9898
'pipe',
9999
['get', 'participants'],
100100
['map', ['pipe', ['get', 'scores'], ['map', ['round']], ['sum']]]

src/parse.test.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,10 @@ for (const [category, testGroups] of Object.entries(testsByCategory)) {
4242

4343
describe('customization', () => {
4444
test('should parse a custom function', () => {
45-
const options: JSONQueryParseOptions = {
46-
functions: { customFn: () => () => 42 }
47-
}
48-
49-
expect(parse('customFn(.age, "desc")', options)).toEqual(['customFn', ['get', 'age'], 'desc'])
45+
expect(parse('customFn(.age, "desc")')).toEqual(['customFn', ['get', 'age'], 'desc'])
5046

5147
// built-in functions should still be available
52-
expect(parse('add(2, 3)', options)).toEqual(['add', 2, 3])
48+
expect(parse('add(2, 3)')).toEqual(['add', 2, 3])
5349
})
5450

5551
test('should parse a custom operator without vararg', () => {

0 commit comments

Comments
 (0)