From bf3fe92136908abdb63a283daf8435349e597235 Mon Sep 17 00:00:00 2001 From: Shinigami Date: Sun, 29 Jun 2025 23:28:05 +0200 Subject: test: add check for const number (#3538) --- test/modules/helpers.spec-d.ts | 8 ++++++-- 1 file 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(); }); + + it('const generic single element', () => { + const actual = faker.helpers.maybe(() => 1 as const); + expectTypeOf(actual).toEqualTypeOf<1 | undefined>(); + }); }); describe('objectKey', () => { -- cgit v1.2.3