-
Notifications
You must be signed in to change notification settings - Fork 724
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixes 706 * Test coverage back to 100% * Preparing release * Preparing release
- Loading branch information
1 parent
d015952
commit 7897f45
Showing
6 changed files
with
41 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
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,33 @@ | ||
import { expect } from "chai"; | ||
import { BindingScopeEnum, Container, injectable } from "../../src/inversify"; | ||
|
||
describe("Issue 706", () => { | ||
|
||
it("Should expose BindingScopeEnum as part of the public API", () => { | ||
|
||
@injectable() | ||
class SomeClass { | ||
public time: number; | ||
public constructor() { | ||
this.time = new Date().getTime(); | ||
} | ||
} | ||
|
||
const container = new Container({ | ||
defaultScope: BindingScopeEnum.Singleton, | ||
}); | ||
|
||
const TYPE = { | ||
SomeClass: Symbol.for("SomeClass") | ||
}; | ||
|
||
container.bind<SomeClass>(TYPE.SomeClass).to(SomeClass); | ||
|
||
const instanceOne = container.get<SomeClass>(TYPE.SomeClass); | ||
const instanceTwo = container.get<SomeClass>(TYPE.SomeClass); | ||
|
||
expect(instanceOne.time).to.eq(instanceTwo.time); | ||
|
||
}); | ||
|
||
}); |