Created
January 4, 2016 10:47
-
-
Save matthewdenobrega/35d6abd5011f348f04e0 to your computer and use it in GitHub Desktop.
Unit tests fail silently on exception in tcb.createAsync.then function
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
import {ComponentFixture, describe, expect, inject, it, TestComponentBuilder} from 'angular2/testing' | |
import {Component, View} from 'angular2/src/core/metadata' | |
@Component({ selector: 'basic-component' }) | |
@View({ template: '<div></div>' }) | |
class BasicComponent { } | |
// Set up the browser adapter | |
import {BrowserDomAdapter} from 'angular2/src/platform/browser/browser_adapter' | |
BrowserDomAdapter.makeCurrent() | |
describe('BasicComponent', () => { | |
it('should create a new component', inject([TestComponentBuilder], (tcb: TestComponentBuilder) => { | |
tcb.createAsync(BasicComponent).then((fixture: ComponentFixture) => { | |
expect(fixture.debugElement).not.toBe(null) | |
throw ('exception') | |
expect(false).toBe(true) | |
}) | |
})) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment