Skip to content

Commit

Permalink
main: lints
Browse files Browse the repository at this point in the history
  • Loading branch information
SomeHats committed Dec 9, 2023
1 parent a993390 commit 085930f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/lib/assert.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ test("normalizes stack traces", () => {
test("automatically inserts an error message", () => {
// this is actually testing code in `vite.config.ts`
expect(() => assert(2 + 2 === 5)).toThrowErrorMatchingInlineSnapshot(
'"Assertion Error: 2 + 2 === 5"',
`[Error: Assertion Error: 2 + 2 === 5]`,
);

expect(() =>
assertExists((() => undefined)()),
).toThrowErrorMatchingInlineSnapshot(
'"Assertion Error: (() => undefined)()"',
`[Error: Assertion Error: (() => undefined)()]`,
);
});
18 changes: 9 additions & 9 deletions src/lib/schema.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ test("Schema.enum", () => {
expect(arraySchema.parse(true).unwrap()).toBe(true);
expect(
arraySchema.parse(false).unwrapError().toString(),
).toMatchInlineSnapshot('"Expected \\"one\\" or 2 or true, got false"');
).toMatchInlineSnapshot(`"Expected "one" or 2 or true, got false"`);

expect(enumSchema.parse("one").unwrap()).toBe(TestEnum.One);
expect(
enumSchema.parse({ hello: "world" }).unwrapError().toString(),
).toMatchInlineSnapshot('"Expected \\"one\\" or \\"two\\", got an object"');
).toMatchInlineSnapshot(`"Expected "one" or "two", got an object"`);
});

test("nested errors", () => {
Expand All @@ -40,7 +40,7 @@ test("nested errors", () => {
.unwrapError()
.toString(),
).toMatchInlineSnapshot(
'"At .foo.four: Expected \\"one\\" or \\"two\\" or \\"three\\", got \\"four\\""',
`"At .foo.four: Expected "one" or "two" or "three", got "four""`,
);
expect(
schema
Expand Down Expand Up @@ -104,15 +104,15 @@ test("UnionSchema", () => {
.unwrapError()
.toString(),
).toMatchInlineSnapshot(
'"At .type: Expected one of \\"cat\\" or \\"dog\\", got a string"',
`"At .type: Expected one of "cat" or "dog", got a string"`,
);
expect(
nested
.parse({ animal: { type: "cow", moo: false } })
.unwrapError()
.toString(),
).toMatchInlineSnapshot(
'"At .animal.type: Expected one of \\"cat\\" or \\"dog\\", got a string"',
`"At .animal.type: Expected one of "cat" or "dog", got a string"`,
);
expect(
nested
Expand Down Expand Up @@ -157,12 +157,12 @@ test("IndexedUnionSchema", () => {
.unwrapError()
.toString(),
).toMatchInlineSnapshot(
'"At .type: Expected one of \\"cat\\" or \\"dog\\", got a string"',
`"At .type: Expected one of "cat" or "dog", got a string"`,
);
expect(
animalSchema.parse(["cow", false]).unwrapError().toString(),
).toMatchInlineSnapshot(
'"At .0: Expected one of \\"cat\\" or \\"dog\\", got a string"',
`"At .0: Expected one of "cat" or "dog", got a string"`,
);

expect(
Expand All @@ -171,15 +171,15 @@ test("IndexedUnionSchema", () => {
.unwrapError()
.toString(),
).toMatchInlineSnapshot(
'"At .animal.type: Expected one of \\"cat\\" or \\"dog\\", got a string"',
`"At .animal.type: Expected one of "cat" or "dog", got a string"`,
);
expect(
nested
.parse([null, ["cow", false]])
.unwrapError()
.toString(),
).toMatchInlineSnapshot(
'"At .animal(1).0: Expected one of \\"cat\\" or \\"dog\\", got a string"',
`"At .animal(1).0: Expected one of "cat" or "dog", got a string"`,
);

expect(
Expand Down

0 comments on commit 085930f

Please sign in to comment.