diff --git a/modules/angular2/test/dev_mode_spec.ts b/modules/angular2/test/dev_mode_spec.ts new file mode 100644 index 0000000000..e241e76bd8 --- /dev/null +++ b/modules/angular2/test/dev_mode_spec.ts @@ -0,0 +1,20 @@ +import { + AsyncTestCompleter, + beforeEach, + ddescribe, + describe, + expect, + iit, + inject, + it, + xdescribe, + xit +} from 'angular2/testing_internal'; + +import {assertionsEnabled} from 'angular2/src/core/facade/lang'; + +export function main() { + describe('dev mode', () => { + it('is enabled in our tests by default', () => { expect(assertionsEnabled()).toBe(true); }); + }); +} diff --git a/modules/angular2/test/public_api_spec.ts b/modules/angular2/test/public_api_spec.ts index f4cae4eda2..472220d19a 100644 --- a/modules/angular2/test/public_api_spec.ts +++ b/modules/angular2/test/public_api_spec.ts @@ -738,6 +738,7 @@ var NG_ALL = [ 'OutputMetadata', 'OutputMetadata.bindingPropertyName', + 'enableDevMode():js', 'ExpressionChangedAfterItHasBeenCheckedException', 'ExpressionChangedAfterItHasBeenCheckedException.message', 'ExpressionChangedAfterItHasBeenCheckedException.stackTrace', diff --git a/test-main.js b/test-main.js index 40c4be42eb..144930c51e 100644 --- a/test-main.js +++ b/test-main.js @@ -18,6 +18,8 @@ System.config({ } }); +window.angularDevMode = true; + // Import all the specs, execute their `main()` method and kick off Karma (Jasmine). System.import('angular2/src/core/dom/browser_adapter').then(function(browser_adapter) { browser_adapter.BrowserDomAdapter.makeCurrent(); diff --git a/tools/broccoli/html-replace/SCRIPTS.html b/tools/broccoli/html-replace/SCRIPTS.html index 0402ad59c7..38bd5efe0e 100644 --- a/tools/broccoli/html-replace/SCRIPTS.html +++ b/tools/broccoli/html-replace/SCRIPTS.html @@ -18,6 +18,7 @@ diff --git a/tools/broccoli/js-replace/SCRIPTS.js b/tools/broccoli/js-replace/SCRIPTS.js index 7ef18d10ad..feb581a9e7 100644 --- a/tools/broccoli/js-replace/SCRIPTS.js +++ b/tools/broccoli/js-replace/SCRIPTS.js @@ -1,2 +1,3 @@ +self.angularDevMode = true; importScripts("es6-shim.js", "zone-microtask.js", "long-stack-trace-zone.js", "system.src.js", "Reflect.js"); diff --git a/tools/cjs-jasmine/index.js b/tools/cjs-jasmine/index.js index 0e97d7fa61..10fc759c0c 100644 --- a/tools/cjs-jasmine/index.js +++ b/tools/cjs-jasmine/index.js @@ -6,6 +6,8 @@ var path = require('path'); require('es6-shim/es6-shim.js'); require('reflect-metadata/Reflect'); +global.angularDevMode = true; + var jrunner = new JasmineRunner(); // Tun on full stack traces in errors to help debugging