-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed bug #80 that instance function worked different if Proxy was su…
…pported or not With Proxy support instance function always returned new object, without support it was always same instance. This changed fixes this issue and instance function now always returns same object.
- Loading branch information
Showing
4 changed files
with
26 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import {instance, mock} from "../src/ts-mockito"; | ||
import {Foo} from "./utils/Foo"; | ||
|
||
describe("instance", () => { | ||
describe("getting instance of mock", () => { | ||
let mockedFoo: Foo; | ||
|
||
it("returns always same instance", () => { | ||
// given | ||
mockedFoo = mock(Foo); | ||
|
||
// when | ||
let firstFooInstance = instance(mockedFoo); | ||
let secondFooInstance = instance(mockedFoo); | ||
|
||
// then | ||
expect(firstFooInstance).toBe(secondFooInstance); | ||
}); | ||
}); | ||
}); |