Skip to content

Commit e0af8f0

Browse files
committed
add invalidate query test
1 parent 935e23c commit e0af8f0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/invalidate_query.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { expect, test } from "vitest";
2+
import { JSONPathJS } from "../src";
3+
4+
test("Query that does not start with $ should throw an error", () => {
5+
expect(() => new JSONPathJS("*")).toThrowError();
6+
});
7+
8+
test("Query with unclosed brackets should throw an error", () => {
9+
expect(() => new JSONPathJS("$.store.book[0")).toThrowError();
10+
});

0 commit comments

Comments
 (0)