Skip to content

Commit

Permalink
Merge pull request #23 from darcyrush/patch-2
Browse files Browse the repository at this point in the history
Update stub-builder.ts to support falsy overrides
  • Loading branch information
ShellyDCMS authored Aug 19, 2024
2 parents 6120be6 + 08e6630 commit 6f4b4b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ts-stubber",
"description": "Lazy Stubbing a TypeScript Class or Interface with any Mocking Framework for testing in Isolation",
"version": "1.0.15",
"version": "1.0.16",
"author": "Shelly Goldblit",
"private": false,
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion src/stub-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const StubbedInstanceCreator = <T, StubT>(
target: Record<string, unknown>,
prop: string
) => {
if (!target[prop]) {
if (!(prop in target)) {
target[prop] = createStub(prop);
}
};
Expand Down

0 comments on commit 6f4b4b2

Please sign in to comment.