We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bee430a commit 4f27b7bCopy full SHA for 4f27b7b
1 file changed
tests/utils.test.ts
@@ -0,0 +1,21 @@
1
+import { handleErr, resolve } from "../src/utils"
2
+
3
+describe("utils", () => {
4
+ describe("resolve", () => {
5
+ test("should resolve function", () => {
6
+ expect(resolve(() => 1, null)).toBe(1)
7
+ expect(resolve((x) => x, 2)).toBe(2)
8
+ })
9
+ test("should resolve value", () => {
10
+ expect(resolve(1, null)).toBe(1)
11
+ expect(resolve(2, 1)).toBe(2)
12
13
14
15
+ describe("handleErr", () => {
16
+ test("should throw error", () => {
17
+ expect(() => handleErr({ name: "test", message: "test" })).toThrow()
18
+ expect(() => handleErr(null as never)).not.toThrow()
19
20
21
+})
0 commit comments