-
-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description
When using the factory overrides to set a property explicitly to undefined this is always allowed even when the type constraint doesn’t accept undefined as a valid value.
To Reproduce
import { Factory } from 'fishery';
interface Foo {
bar: string;
}
const fooFactory = Factory.define<Foo>(() => {
return { bar: 'any-value' };
});
const result = fooFactory.build({ bar: undefined }); // result has the type Foo but its value is { bar: undefined } which is not a valid FooAdditional context
It seems like this bug has been introduced with #44
carmanchris31
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working