-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added test case * WIP implementation * Implemented issue 590
- Loading branch information
1 parent
6083280
commit 01448b5
Showing
7 changed files
with
58 additions
and
11 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
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,26 @@ | ||
import { expect } from "chai"; | ||
import { Container } from "inversify"; | ||
import { InversifyExpressServer, cleanUpMetadata } from "../src/index"; | ||
import { NO_CONTROLLERS_FOUND } from "../src/constants"; | ||
|
||
describe("Issue 590", () => { | ||
|
||
beforeEach(() => { | ||
cleanUpMetadata(); | ||
}); | ||
|
||
it("should throw if no bindings for controllers are declared", () => { | ||
let container = new Container(); | ||
let server = new InversifyExpressServer(container); | ||
const throws = () => server.build(); | ||
expect(throws).to.throw(NO_CONTROLLERS_FOUND); | ||
}); | ||
|
||
it("should not throw if forceControllers is false and no bindings for controllers are declared", () => { | ||
let container = new Container(); | ||
let server = new InversifyExpressServer(container, null, null, null, null, false); | ||
const throws = () => server.build(); | ||
expect(throws).not.to.throw(); | ||
}); | ||
|
||
}); |