Created
August 7, 2017 10:18
-
-
Save davismj/38bf9ca764213927c709cac438635c2d to your computer and use it in GitHub Desktop.
DI and Unit Testing
This file contains hidden or 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
| import { Container } from 'aurelia-dependency-injection'; | |
| describe('the unit test', () => { | |
| let container; | |
| beforeEach() { | |
| container = new Container(); | |
| // Off the top of my head, I'm not sure how we would create an element in jasmine. I want to say it would look something like this. Since this isn't what you're really interested in, I'm just leaving it like this for now. It's probably wrong. | |
| container.registerInstance(Element, new Element()); | |
| } | |
| it('should have an element in its container', () => { | |
| let el = container.get(Element); | |
| expect(el).toBeDefined(); | |
| }); | |
| }); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment