Skip to content

Commit

Permalink
Add tests for #513
Browse files Browse the repository at this point in the history
  • Loading branch information
jpwilliams committed Mar 6, 2024
1 parent 2af3b79 commit 660f9b4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/inngest/src/helpers/jsonify.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ describe("Jsonify", () => {
assertType<IsEqual<Actual, Expected>>(true);
});

test("#513 appropriately types `string | null`", () => {
type Actual = Jsonify<string | null>;
type Expected = string | null;
assertType<IsAny<Actual>>(false);
assertType<IsEqual<Actual, Expected>>(true);
});

describe("object", () => {
test("allows `any`", () => {
type Actual = Jsonify<{ foo: any }>;
Expand All @@ -50,5 +57,12 @@ describe("Jsonify", () => {
type Expected = { foo: "bar" };
assertType<IsEqual<Actual, Expected>>(true);
});

test("#513 appropriately types `string | null`", () => {
type Actual = Jsonify<{ foo: string | null }>;
type Expected = { foo: string | null };
assertType<IsAny<Actual["foo"]>>(false);
assertType<IsEqual<Actual, Expected>>(true);
});
});
});

0 comments on commit 660f9b4

Please sign in to comment.