Skip to content

Commit 7f24b86

Browse files
committed
Avoid unnecessary toMatchInlineSnapshot in decoders test
1 parent 358a72a commit 7f24b86

File tree

1 file changed

+5
-30
lines changed

1 file changed

+5
-30
lines changed

tests/decoders.test.ts

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -41,36 +41,11 @@ test("boolean", () => {
4141
});
4242

4343
test("number", () => {
44-
expect(number(0)).toMatchInlineSnapshot(`
45-
{
46-
"tag": "Valid",
47-
"value": 0,
48-
}
49-
`);
50-
expect(number(Math.PI)).toMatchInlineSnapshot(`
51-
{
52-
"tag": "Valid",
53-
"value": 3.141592653589793,
54-
}
55-
`);
56-
expect(number(NaN)).toMatchInlineSnapshot(`
57-
{
58-
"tag": "Valid",
59-
"value": NaN,
60-
}
61-
`);
62-
expect(number(Infinity)).toMatchInlineSnapshot(`
63-
{
64-
"tag": "Valid",
65-
"value": Infinity,
66-
}
67-
`);
68-
expect(number(-Infinity)).toMatchInlineSnapshot(`
69-
{
70-
"tag": "Valid",
71-
"value": -Infinity,
72-
}
73-
`);
44+
expect(run(number, 0)).toBe(0);
45+
expect(run(number, Math.PI)).toBe(3.141592653589793);
46+
expect(run(number, NaN)).toBeNaN();
47+
expect(run(number, Infinity)).toBe(Infinity);
48+
expect(run(number, -Infinity)).toBe(-Infinity);
7449

7550
expectType<DecoderResult<number>>(number(0));
7651
// @ts-expect-error Expected 1 arguments, but got 2.

0 commit comments

Comments
 (0)