Skip to content

Commit

Permalink
Avoid unnecessary toMatchInlineSnapshot in decoders test
Browse files Browse the repository at this point in the history
  • Loading branch information
lydell committed Oct 27, 2023
1 parent b30c4d8 commit 75d404a
Showing 1 changed file with 5 additions and 30 deletions.
35 changes: 5 additions & 30 deletions tests/decoders.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,36 +41,11 @@ test("boolean", () => {
});

test("number", () => {
expect(number(0)).toMatchInlineSnapshot(`
{
"tag": "Valid",
"value": 0,
}
`);
expect(number(Math.PI)).toMatchInlineSnapshot(`
{
"tag": "Valid",
"value": 3.141592653589793,
}
`);
expect(number(NaN)).toMatchInlineSnapshot(`
{
"tag": "Valid",
"value": NaN,
}
`);
expect(number(Infinity)).toMatchInlineSnapshot(`
{
"tag": "Valid",
"value": Infinity,
}
`);
expect(number(-Infinity)).toMatchInlineSnapshot(`
{
"tag": "Valid",
"value": -Infinity,
}
`);
expect(run(number, 0)).toBe(0);
expect(run(number, Math.PI)).toBe(3.141592653589793);
expect(run(number, NaN)).toBeNaN();
expect(run(number, Infinity)).toBe(Infinity);
expect(run(number, -Infinity)).toBe(-Infinity);

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

0 comments on commit 75d404a

Please sign in to comment.