test: add a test verifying that the tests are run in the checked mode
This commit is contained in:
parent
093b7948be
commit
442d6866da
|
@ -11,10 +11,23 @@ import {
|
|||
xit
|
||||
} from 'angular2/testing_internal';
|
||||
|
||||
import {assertionsEnabled} from 'angular2/src/facade/lang';
|
||||
import {assertionsEnabled, IS_DART} from 'angular2/src/facade/lang';
|
||||
|
||||
export function main() {
|
||||
describe('dev mode', () => {
|
||||
it('is enabled in our tests by default', () => { expect(assertionsEnabled()).toBe(true); });
|
||||
});
|
||||
|
||||
if (IS_DART) {
|
||||
describe('checked mode', () => {
|
||||
it('is enabled in our tests', () => {
|
||||
try {
|
||||
var s: string = <any>42;
|
||||
expect(s).toEqual(42); // without it, dart analyzer will complain that `s` is not used.
|
||||
throw "should not be reached";
|
||||
} catch (e) {
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue