Skip to content

Commit

Permalink
Fix type tests for t.assert()
Browse files Browse the repository at this point in the history
  • Loading branch information
novemberborn committed Oct 22, 2023
1 parent 0d7bbd5 commit c792f10
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test-types/import-in-cts/assertions-as-type-guards.cts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const expected: Expected = {foo: 'bar'};

test('assert', t => {
const actual = expected as Expected | undefined;
if (t.truthy(actual)) {
if (t.assert(actual)) {
expectType<Expected>(actual);
} else {
expectType<undefined>(actual);
Expand Down
2 changes: 1 addition & 1 deletion test-types/module/assertions-as-type-guards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const expected: Expected = {foo: 'bar'};

test('assert', t => {
const actual = expected as Expected | undefined;
if (t.truthy(actual)) {
if (t.assert(actual)) {
expectType<Expected>(actual);
} else {
expectType<undefined>(actual);
Expand Down

0 comments on commit c792f10

Please sign in to comment.