Skip to content

Commit

Permalink
chore: add tests for each readonly type check
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnusG committed Feb 11, 2022
1 parent ac7e256 commit 9784b1a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/core/test/each.test.ts
Expand Up @@ -26,6 +26,20 @@ describe.each([
})
})

describe.each([
[1, 'a', '1a'],
[1, 'b', '1b'],
[2, 'c', '2c'],
] as const)('describe concatenate(%i, %s)', (a, b, expected) => {
test(`returns ${expected}`, () => {
// This will fail typechecking if const is not used and/or types for a,b are merged into a union
const typedA: number = a
const typedB: string = b

expect(`${typedA}${typedB}`).toBe(expected)
})
})

describe.each([
{ a: 1, b: 1, expected: 2 },
{ a: 1, b: 2, expected: 3 },
Expand Down

0 comments on commit 9784b1a

Please sign in to comment.