We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a53d5a3 commit bf3fe92Copy full SHA for bf3fe92
test/modules/helpers.spec-d.ts
@@ -45,11 +45,15 @@ describe('helpers', () => {
45
});
46
47
describe('maybe', () => {
48
- it('const generic single element', () => {
49
- // TODO @ST-DDT 2024-02-25: Check why this is detected as `number` instead of `1`
+ it('generic single element', () => {
50
const actual = faker.helpers.maybe(() => 1);
51
expectTypeOf(actual).toEqualTypeOf<number | undefined>();
52
+
53
+ it('const generic single element', () => {
54
+ const actual = faker.helpers.maybe(() => 1 as const);
55
+ expectTypeOf(actual).toEqualTypeOf<1 | undefined>();
56
+ });
57
58
59
describe('objectKey', () => {
0 commit comments