From 442d6866da14749588b8021259a6c7c8125ef782 Mon Sep 17 00:00:00 2001 From: vsavkin Date: Tue, 1 Dec 2015 15:41:46 -0800 Subject: [PATCH] test: add a test verifying that the tests are run in the checked mode --- modules/angular2/test/dev_mode_spec.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/angular2/test/dev_mode_spec.ts b/modules/angular2/test/dev_mode_spec.ts index e8828d2862..08879ee819 100644 --- a/modules/angular2/test/dev_mode_spec.ts +++ b/modules/angular2/test/dev_mode_spec.ts @@ -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 = 42; + expect(s).toEqual(42); // without it, dart analyzer will complain that `s` is not used. + throw "should not be reached"; + } catch (e) { + } + }); + }); + } }