diff options
| author | Shinigami <[email protected]> | 2025-06-29 23:28:05 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-06-29 23:28:05 +0200 |
| commit | bf3fe92136908abdb63a283daf8435349e597235 (patch) | |
| tree | ba1868711340d3a9f4d0b1f53e3ed417cc321ace /test | |
| parent | a53d5a338d2ca25cba8b76abe085492771ef0bac (diff) | |
| download | faker-bf3fe92136908abdb63a283daf8435349e597235.tar.xz faker-bf3fe92136908abdb63a283daf8435349e597235.zip | |
test: add check for const number (#3538)
Diffstat (limited to 'test')
| -rw-r--r-- | test/modules/helpers.spec-d.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/modules/helpers.spec-d.ts b/test/modules/helpers.spec-d.ts index 11ce8c88..7e1729d8 100644 --- a/test/modules/helpers.spec-d.ts +++ b/test/modules/helpers.spec-d.ts @@ -45,11 +45,15 @@ describe('helpers', () => { }); describe('maybe', () => { - it('const generic single element', () => { - // TODO @ST-DDT 2024-02-25: Check why this is detected as `number` instead of `1` + it('generic single element', () => { const actual = faker.helpers.maybe(() => 1); expectTypeOf(actual).toEqualTypeOf<number | undefined>(); }); + + it('const generic single element', () => { + const actual = faker.helpers.maybe(() => 1 as const); + expectTypeOf(actual).toEqualTypeOf<1 | undefined>(); + }); }); describe('objectKey', () => { |
