diff --git a/packages/ember-runtime/tests/legacy_1x/mixins/observable/observable_test.js b/packages/ember-runtime/tests/legacy_1x/mixins/observable/observable_test.js index 3e22b0ef229..0e2fd777c8e 100644 --- a/packages/ember-runtime/tests/legacy_1x/mixins/observable/observable_test.js +++ b/packages/ember-runtime/tests/legacy_1x/mixins/observable/observable_test.js @@ -147,14 +147,6 @@ moduleFor( assert.equal(get(objectB, 'nullProperty'), null); } - /* - QUnit.test("raise if the provided object is null", function() { - throws(function() { - get(null, 'key'); - }); - }); - */ - ['@test raise if the provided object is undefined']() { expectAssertion(function() { get(undefined, 'key'); diff --git a/packages/ember/tests/error_handler_test.js b/packages/ember/tests/error_handler_test.js index 1a9e3e5c5ac..cb82804230a 100644 --- a/packages/ember/tests/error_handler_test.js +++ b/packages/ember/tests/error_handler_test.js @@ -1,283 +1,401 @@ import { isTesting, setTesting } from 'ember-debug'; import { run, later, getOnerror, setOnerror } from 'ember-metal'; import RSVP from 'rsvp'; +import { moduleFor, AbstractTestCase } from 'internal-test-helpers'; let WINDOW_ONERROR; -QUnit.module('error_handler', { - beforeEach() { - // capturing this outside of module scope to ensure we grab - // the test frameworks own window.onerror to reset it - WINDOW_ONERROR = window.onerror; - }, - - afterEach() { - setTesting(isTesting); - window.onerror = WINDOW_ONERROR; - - setOnerror(undefined); - }, -}); - function runThatThrowsSync(message = 'Error for testing error handling') { return run(() => { throw new Error(message); }); } -QUnit.test('by default there is no onerror - sync run', function(assert) { - assert.strictEqual( - getOnerror(), - undefined, - 'precond - there should be no Ember.onerror set by default' - ); - assert.throws(runThatThrowsSync, Error, 'errors thrown sync are catchable'); -}); - -QUnit.test('when Ember.onerror (which rethrows) is registered - sync run', function(assert) { - assert.expect(2); - setOnerror(function(error) { - assert.ok(true, 'onerror called'); - throw error; - }); - assert.throws(runThatThrowsSync, Error, 'error is thrown'); -}); - -QUnit.test('when Ember.onerror (which does not rethrow) is registered - sync run', function( - assert -) { - assert.expect(2); - setOnerror(function() { - assert.ok(true, 'onerror called'); - }); - runThatThrowsSync(); - assert.ok(true, 'no error was thrown, Ember.onerror can intercept errors'); -}); - -QUnit.test( - 'does not swallow exceptions by default (Ember.testing = true, no Ember.onerror) - sync run', - function(assert) { - setTesting(true); - - let error = new Error('the error'); - assert.throws(() => { - run(() => { +moduleFor( + 'error_handler', + class extends AbstractTestCase { + beforeEach() { + // capturing this outside of module scope to ensure we grab + // the test frameworks own window.onerror to reset it + WINDOW_ONERROR = window.onerror; + } + + afterEach() { + setTesting(isTesting); + window.onerror = WINDOW_ONERROR; + + setOnerror(undefined); + } + + ['@test by default there is no onerror - sync run'](assert) { + assert.strictEqual( + getOnerror(), + undefined, + 'precond - there should be no Ember.onerror set by default' + ); + assert.throws(runThatThrowsSync, Error, 'errors thrown sync are catchable'); + } + + ['@test when Ember.onerror (which rethrows) is registered - sync run'](assert) { + assert.expect(2); + setOnerror(function(error) { + assert.ok(true, 'onerror called'); throw error; }); - }, error); - } -); + assert.throws(runThatThrowsSync, Error, 'error is thrown'); + } -QUnit.test( - 'does not swallow exceptions by default (Ember.testing = false, no Ember.onerror) - sync run', - function(assert) { - setTesting(false); - let error = new Error('the error'); - assert.throws(() => { - run(() => { - throw error; + ['@test when Ember.onerror (which does not rethrow) is registered - sync run'](assert) { + assert.expect(2); + setOnerror(function() { + assert.ok(true, 'onerror called'); }); - }, error); - } -); + runThatThrowsSync(); + assert.ok(true, 'no error was thrown, Ember.onerror can intercept errors'); + } -QUnit.test( - 'does not swallow exceptions (Ember.testing = false, Ember.onerror which rethrows) - sync run', - function(assert) { - assert.expect(2); - setTesting(false); + ['@test does not swallow exceptions by default (Ember.testing = true, no Ember.onerror) - sync run']( + assert + ) { + setTesting(true); - setOnerror(function(error) { - assert.ok(true, 'Ember.onerror was called'); - throw error; - }); + let error = new Error('the error'); + assert.throws(() => { + run(() => { + throw error; + }); + }, error); + } - let error = new Error('the error'); - assert.throws(() => { - run(() => { + ['@test does not swallow exceptions by default (Ember.testing = false, no Ember.onerror) - sync run']( + assert + ) { + setTesting(false); + let error = new Error('the error'); + assert.throws(() => { + run(() => { + throw error; + }); + }, error); + } + + ['@test does not swallow exceptions (Ember.testing = false, Ember.onerror which rethrows) - sync run']( + assert + ) { + assert.expect(2); + setTesting(false); + + setOnerror(function(error) { + assert.ok(true, 'Ember.onerror was called'); throw error; }); - }, error); - } -); -QUnit.test( - 'Ember.onerror can intercept errors (aka swallow) by not rethrowing (Ember.testing = false) - sync run', - function(assert) { - assert.expect(1); - setTesting(false); + let error = new Error('the error'); + assert.throws(() => { + run(() => { + throw error; + }); + }, error); + } - setOnerror(function() { - assert.ok(true, 'Ember.onerror was called'); - }); + ['@test Ember.onerror can intercept errors (aka swallow) by not rethrowing (Ember.testing = false) - sync run']( + assert + ) { + assert.expect(1); + setTesting(false); - let error = new Error('the error'); - try { - run(() => { - throw error; + setOnerror(function() { + assert.ok(true, 'Ember.onerror was called'); }); - } catch (e) { - assert.notOk( - true, - 'Ember.onerror that does not rethrow is intentionally swallowing errors, try / catch wrapping does not see error' - ); + + let error = new Error('the error'); + try { + run(() => { + throw error; + }); + } catch (e) { + assert.notOk( + true, + 'Ember.onerror that does not rethrow is intentionally swallowing errors, try / catch wrapping does not see error' + ); + } + } + + ['@test does not swallow exceptions by default (Ember.testing = true, no Ember.onerror) - async run']( + assert + ) { + let done = assert.async(); + let caughtByWindowOnerror; + + setTesting(true); + + window.onerror = function(message) { + caughtByWindowOnerror = message; + // prevent "bubbling" and therefore failing the test + return true; + }; + + later(() => { + throw new Error('the error'); + }, 10); + + setTimeout(() => { + assert.pushResult({ + result: /the error/.test(caughtByWindowOnerror), + actual: caughtByWindowOnerror, + expected: 'to include `the error`', + message: + 'error should bubble out to window.onerror, and therefore fail tests (due to QUnit implementing window.onerror)', + }); + + done(); + }, 20); } - } -); -QUnit.test( - 'does not swallow exceptions by default (Ember.testing = true, no Ember.onerror) - async run', - function(assert) { - let done = assert.async(); - let caughtByWindowOnerror; - - setTesting(true); - - window.onerror = function(message) { - caughtByWindowOnerror = message; - // prevent "bubbling" and therefore failing the test - return true; - }; - - later(() => { - throw new Error('the error'); - }, 10); - - setTimeout(() => { - assert.pushResult({ - result: /the error/.test(caughtByWindowOnerror), - actual: caughtByWindowOnerror, - expected: 'to include `the error`', - message: - 'error should bubble out to window.onerror, and therefore fail tests (due to QUnit implementing window.onerror)', + ['@test does not swallow exceptions by default (Ember.testing = false, no Ember.onerror) - async run']( + assert + ) { + let done = assert.async(); + let caughtByWindowOnerror; + + setTesting(false); + + window.onerror = function(message) { + caughtByWindowOnerror = message; + // prevent "bubbling" and therefore failing the test + return true; + }; + + later(() => { + throw new Error('the error'); + }, 10); + + setTimeout(() => { + assert.pushResult({ + result: /the error/.test(caughtByWindowOnerror), + actual: caughtByWindowOnerror, + expected: 'to include `the error`', + message: + 'error should bubble out to window.onerror, and therefore fail tests (due to QUnit implementing window.onerror)', + }); + + done(); + }, 20); + } + + ['@test Ember.onerror can intercept errors (aka swallow) by not rethrowing (Ember.testing = false) - async run']( + assert + ) { + let done = assert.async(); + + setTesting(false); + + window.onerror = function() { + assert.notOk( + true, + 'window.onerror is never invoked when Ember.onerror intentionally swallows errors' + ); + // prevent "bubbling" and therefore failing the test + return true; + }; + + let thrown = new Error('the error'); + setOnerror(function(error) { + assert.strictEqual(error, thrown, 'Ember.onerror is called with the error'); }); - done(); - }, 20); - } -); + later(() => { + throw thrown; + }, 10); -QUnit.test( - 'does not swallow exceptions by default (Ember.testing = false, no Ember.onerror) - async run', - function(assert) { - let done = assert.async(); - let caughtByWindowOnerror; - - setTesting(false); - - window.onerror = function(message) { - caughtByWindowOnerror = message; - // prevent "bubbling" and therefore failing the test - return true; - }; - - later(() => { - throw new Error('the error'); - }, 10); - - setTimeout(() => { - assert.pushResult({ - result: /the error/.test(caughtByWindowOnerror), - actual: caughtByWindowOnerror, - expected: 'to include `the error`', - message: - 'error should bubble out to window.onerror, and therefore fail tests (due to QUnit implementing window.onerror)', + setTimeout(done, 20); + } + + [`@test errors in promise constructor when Ember.onerror which does not rethrow is present - rsvp`]( + assert + ) { + assert.expect(1); + + let thrown = new Error('the error'); + setOnerror(function(error) { + assert.strictEqual( + error, + thrown, + 'Ember.onerror is called for errors thrown in RSVP promises' + ); }); - done(); - }, 20); - } -); + new RSVP.Promise(() => { + throw thrown; + }); -QUnit.test( - 'Ember.onerror can intercept errors (aka swallow) by not rethrowing (Ember.testing = false) - async run', - function(assert) { - let done = assert.async(); + // RSVP.Promise's are configured to settle within the run loop, this + // ensures that run loop has completed + return new RSVP.Promise(resolve => setTimeout(resolve, 10)); + } - setTesting(false); + [`@test errors in promise constructor when Ember.onerror which does rethrow is present - rsvp`]( + assert + ) { + assert.expect(2); - window.onerror = function() { - assert.notOk( - true, - 'window.onerror is never invoked when Ember.onerror intentionally swallows errors' - ); - // prevent "bubbling" and therefore failing the test - return true; - }; + let thrown = new Error('the error'); + setOnerror(function(error) { + assert.strictEqual( + error, + thrown, + 'Ember.onerror is called for errors thrown in RSVP promises' + ); + throw error; + }); - let thrown = new Error('the error'); - setOnerror(function(error) { - assert.strictEqual(error, thrown, 'Ember.onerror is called with the error'); - }); + window.onerror = function(message) { + assert.pushResult({ + result: /the error/.test(message), + actual: message, + expected: 'to include `the error`', + message: + 'error should bubble out to window.onerror, and therefore fail tests (due to QUnit implementing window.onerror)', + }); - later(() => { - throw thrown; - }, 10); + // prevent "bubbling" and therefore failing the test + return true; + }; - setTimeout(done, 20); - } -); + new RSVP.Promise(() => { + throw thrown; + }); -function generateRSVPErrorHandlingTests(message, generatePromise, timeout = 10) { - QUnit.test(`${message} when Ember.onerror which does not rethrow is present - rsvp`, function( - assert - ) { - assert.expect(1); + // RSVP.Promise's are configured to settle within the run loop, this + // ensures that run loop has completed + return new RSVP.Promise(resolve => setTimeout(resolve, 10)); + } - let thrown = new Error('the error'); - setOnerror(function(error) { - assert.strictEqual( - error, - thrown, - 'Ember.onerror is called for errors thrown in RSVP promises' - ); - }); + [`@test errors in promise constructor when Ember.onerror which does not rethrow is present (Ember.testing = false) - rsvp`]( + assert + ) { + assert.expect(1); - generatePromise(thrown); + setTesting(false); + let thrown = new Error('the error'); + setOnerror(function(error) { + assert.strictEqual( + error, + thrown, + 'Ember.onerror is called for errors thrown in RSVP promises' + ); + }); - // RSVP.Promise's are configured to settle within the run loop, this - // ensures that run loop has completed - return new RSVP.Promise(resolve => setTimeout(resolve, timeout)); - }); + new RSVP.Promise(() => { + throw thrown; + }); - QUnit.test(`${message} when Ember.onerror which does rethrow is present - rsvp`, function( - assert - ) { - assert.expect(2); + // RSVP.Promise's are configured to settle within the run loop, this + // ensures that run loop has completed + return new RSVP.Promise(resolve => setTimeout(resolve, 10)); + } - let thrown = new Error('the error'); - setOnerror(function(error) { - assert.strictEqual( - error, - thrown, - 'Ember.onerror is called for errors thrown in RSVP promises' - ); - throw error; - }); - - window.onerror = function(message) { - assert.pushResult({ - result: /the error/.test(message), - actual: message, - expected: 'to include `the error`', - message: - 'error should bubble out to window.onerror, and therefore fail tests (due to QUnit implementing window.onerror)', + [`@test errors in promise constructor when Ember.onerror which does rethrow is present (Ember.testing = false) - rsvp`]( + assert + ) { + assert.expect(2); + + setTesting(false); + let thrown = new Error('the error'); + setOnerror(function(error) { + assert.strictEqual( + error, + thrown, + 'Ember.onerror is called for errors thrown in RSVP promises' + ); + throw error; }); - // prevent "bubbling" and therefore failing the test - return true; - }; + window.onerror = function(message) { + assert.pushResult({ + result: /the error/.test(message), + actual: message, + expected: 'to include `the error`', + message: + 'error should bubble out to window.onerror, and therefore fail tests (due to QUnit implementing window.onerror)', + }); - generatePromise(thrown); + // prevent "bubbling" and therefore failing the test + return true; + }; - // RSVP.Promise's are configured to settle within the run loop, this - // ensures that run loop has completed - return new RSVP.Promise(resolve => setTimeout(resolve, timeout)); - }); + new RSVP.Promise(() => { + throw thrown; + }); + + // RSVP.Promise's are configured to settle within the run loop, this + // ensures that run loop has completed + return new RSVP.Promise(resolve => setTimeout(resolve, 10)); + } + + [`@test errors in promise .then callback when Ember.onerror which does not rethrow is present - rsvp`]( + assert + ) { + assert.expect(1); + + let thrown = new Error('the error'); + setOnerror(function(error) { + assert.strictEqual( + error, + thrown, + 'Ember.onerror is called for errors thrown in RSVP promises' + ); + }); + + RSVP.resolve().then(() => { + throw thrown; + }); + + // RSVP.Promise's are configured to settle within the run loop, this + // ensures that run loop has completed + return new RSVP.Promise(resolve => setTimeout(resolve, 10)); + } + + [`@test errors in promise .then callback when Ember.onerror which does rethrow is present - rsvp`]( + assert + ) { + assert.expect(2); + + let thrown = new Error('the error'); + setOnerror(function(error) { + assert.strictEqual( + error, + thrown, + 'Ember.onerror is called for errors thrown in RSVP promises' + ); + throw error; + }); + + window.onerror = function(message) { + assert.pushResult({ + result: /the error/.test(message), + actual: message, + expected: 'to include `the error`', + message: + 'error should bubble out to window.onerror, and therefore fail tests (due to QUnit implementing window.onerror)', + }); + + // prevent "bubbling" and therefore failing the test + return true; + }; + + RSVP.resolve().then(() => { + throw thrown; + }); + + // RSVP.Promise's are configured to settle within the run loop, this + // ensures that run loop has completed + return new RSVP.Promise(resolve => setTimeout(resolve, 10)); + } - QUnit.test( - `${message} when Ember.onerror which does not rethrow is present (Ember.testing = false) - rsvp`, - function(assert) { + [`@test errors in promise .then callback when Ember.onerror which does not rethrow is present (Ember.testing = false) - rsvp`]( + assert + ) { assert.expect(1); setTesting(false); @@ -290,17 +408,18 @@ function generateRSVPErrorHandlingTests(message, generatePromise, timeout = 10) ); }); - generatePromise(thrown); + RSVP.resolve().then(() => { + throw thrown; + }); // RSVP.Promise's are configured to settle within the run loop, this // ensures that run loop has completed - return new RSVP.Promise(resolve => setTimeout(resolve, timeout)); + return new RSVP.Promise(resolve => setTimeout(resolve, 10)); } - ); - QUnit.test( - `${message} when Ember.onerror which does rethrow is present (Ember.testing = false) - rsvp`, - function(assert) { + [`@test errors in promise .then callback when Ember.onerror which does rethrow is present (Ember.testing = false) - rsvp`]( + assert + ) { assert.expect(2); setTesting(false); @@ -327,33 +446,135 @@ function generateRSVPErrorHandlingTests(message, generatePromise, timeout = 10) return true; }; - generatePromise(thrown); + RSVP.resolve().then(() => { + throw thrown; + }); // RSVP.Promise's are configured to settle within the run loop, this // ensures that run loop has completed - return new RSVP.Promise(resolve => setTimeout(resolve, timeout)); + return new RSVP.Promise(resolve => setTimeout(resolve, 10)); } - ); -} -generateRSVPErrorHandlingTests('errors in promise constructor', error => { - new RSVP.Promise(() => { - throw error; - }); -}); + [`@test errors in async promise .then callback when Ember.onerror which does not rethrow is present - rsvp`]( + assert + ) { + assert.expect(1); -generateRSVPErrorHandlingTests('errors in promise .then callback', error => { - RSVP.resolve().then(() => { - throw error; - }); -}); - -generateRSVPErrorHandlingTests( - 'errors in async promise .then callback', - error => { - new RSVP.Promise(resolve => setTimeout(resolve, 10)).then(() => { - throw error; - }); - }, - 20 + let thrown = new Error('the error'); + setOnerror(function(error) { + assert.strictEqual( + error, + thrown, + 'Ember.onerror is called for errors thrown in RSVP promises' + ); + }); + + new RSVP.Promise(resolve => setTimeout(resolve, 10)).then(() => { + throw thrown; + }); + + // RSVP.Promise's are configured to settle within the run loop, this + // ensures that run loop has completed + return new RSVP.Promise(resolve => setTimeout(resolve, 20)); + } + + [`@test errors in async promise .then callback when Ember.onerror which does rethrow is present - rsvp`]( + assert + ) { + assert.expect(2); + + let thrown = new Error('the error'); + setOnerror(function(error) { + assert.strictEqual( + error, + thrown, + 'Ember.onerror is called for errors thrown in RSVP promises' + ); + throw error; + }); + + window.onerror = function(message) { + assert.pushResult({ + result: /the error/.test(message), + actual: message, + expected: 'to include `the error`', + message: + 'error should bubble out to window.onerror, and therefore fail tests (due to QUnit implementing window.onerror)', + }); + + // prevent "bubbling" and therefore failing the test + return true; + }; + + new RSVP.Promise(resolve => setTimeout(resolve, 10)).then(() => { + throw thrown; + }); + + // RSVP.Promise's are configured to settle within the run loop, this + // ensures that run loop has completed + return new RSVP.Promise(resolve => setTimeout(resolve, 20)); + } + + [`@test errors in async promise .then callback when Ember.onerror which does not rethrow is present (Ember.testing = false) - rsvp`]( + assert + ) { + assert.expect(1); + + setTesting(false); + let thrown = new Error('the error'); + setOnerror(function(error) { + assert.strictEqual( + error, + thrown, + 'Ember.onerror is called for errors thrown in RSVP promises' + ); + }); + + new RSVP.Promise(resolve => setTimeout(resolve, 10)).then(() => { + throw thrown; + }); + + // RSVP.Promise's are configured to settle within the run loop, this + // ensures that run loop has completed + return new RSVP.Promise(resolve => setTimeout(resolve, 20)); + } + + [`@test errors in async promise .then callback when Ember.onerror which does rethrow is present (Ember.testing = false) - rsvp`]( + assert + ) { + assert.expect(2); + + setTesting(false); + let thrown = new Error('the error'); + setOnerror(function(error) { + assert.strictEqual( + error, + thrown, + 'Ember.onerror is called for errors thrown in RSVP promises' + ); + throw error; + }); + + window.onerror = function(message) { + assert.pushResult({ + result: /the error/.test(message), + actual: message, + expected: 'to include `the error`', + message: + 'error should bubble out to window.onerror, and therefore fail tests (due to QUnit implementing window.onerror)', + }); + + // prevent "bubbling" and therefore failing the test + return true; + }; + + new RSVP.Promise(resolve => setTimeout(resolve, 10)).then(() => { + throw thrown; + }); + + // RSVP.Promise's are configured to settle within the run loop, this + // ensures that run loop has completed + return new RSVP.Promise(resolve => setTimeout(resolve, 20)); + } + } ); diff --git a/packages/ember/tests/production_build_test.js b/packages/ember/tests/production_build_test.js index 428b4f1c69b..d2e0e43051d 100644 --- a/packages/ember/tests/production_build_test.js +++ b/packages/ember/tests/production_build_test.js @@ -1,24 +1,34 @@ import { DEBUG } from 'ember-env-flags'; import { assert as emberAssert, runInDebug } from 'ember-debug'; +import { moduleFor, AbstractTestCase } from 'internal-test-helpers'; -QUnit.module('production builds'); +moduleFor( + 'production builds', + class extends AbstractTestCase { + ['@test assert does not throw in production builds'](assert) { + if (!DEBUG) { + assert.expect(1); -if (!DEBUG) { - QUnit.test('assert does not throw in production builds', function(assert) { - assert.expect(1); - - try { - emberAssert('Should not throw'); - assert.ok(true, 'Ember.assert did not throw'); - } catch (e) { - assert.ok(false, `Expected assert not to throw but it did: ${e.message}`); + try { + emberAssert('Should not throw'); + assert.ok(true, 'Ember.assert did not throw'); + } catch (e) { + assert.ok(false, `Expected assert not to throw but it did: ${e.message}`); + } + } else { + assert.expect(0); + } } - }); - QUnit.test('runInDebug does not run the callback in production builds', function(assert) { - let fired = false; - runInDebug(() => (fired = true)); + ['@test runInDebug does not run the callback in production builds'](assert) { + if (!DEBUG) { + let fired = false; + runInDebug(() => (fired = true)); - assert.equal(fired, false, 'runInDebug callback should not be ran'); - }); -} + assert.equal(fired, false, 'runInDebug callback should not be ran'); + } else { + assert.expect(0); + } + } + } +); diff --git a/packages/ember/tests/reexports_test.js b/packages/ember/tests/reexports_test.js index ea475042394..86718c9f7ce 100644 --- a/packages/ember/tests/reexports_test.js +++ b/packages/ember/tests/reexports_test.js @@ -2,8 +2,50 @@ import Ember from '../index'; import { ENV } from 'ember-environment'; import { confirmExport } from 'internal-test-helpers'; import { DEBUG } from 'ember-env-flags'; +import { moduleFor, AbstractTestCase } from 'internal-test-helpers'; -QUnit.module('ember reexports'); +moduleFor( + 'ember reexports', + class extends AbstractTestCase { + [`@test Ember exports correctly`](assert) { + allExports.forEach(reexport => { + let [path, moduleId, exportName] = reexport; + + // default path === exportName if none present + if (!exportName) { + exportName = path; + } + + confirmExport(Ember, assert, path, moduleId, exportName, `Ember.${path} exports correctly`); + }); + } + + ['@test Ember.String.isHTMLSafe exports correctly'](assert) { + confirmExport(Ember, assert, 'String.isHTMLSafe', 'ember-glimmer', 'isHTMLSafe'); + } + + ['@test Ember.MODEL_FACTORY_INJECTIONS'](assert) { + if (DEBUG) { + let descriptor = Object.getOwnPropertyDescriptor(Ember, 'MODEL_FACTORY_INJECTIONS'); + assert.equal(descriptor.enumerable, false, 'descriptor is not enumerable'); + assert.equal(descriptor.configurable, false, 'descriptor is not configurable'); + + assert.equal(Ember.MODEL_FACTORY_INJECTIONS, false); + + expectDeprecation(function() { + Ember.MODEL_FACTORY_INJECTIONS = true; + }, 'Ember.MODEL_FACTORY_INJECTIONS is no longer required'); + assert.equal( + Ember.MODEL_FACTORY_INJECTIONS, + false, + 'writing to the property has no affect' + ); + } else { + assert.expect(0); + } + } + } +); let allExports = [ // ember-utils @@ -217,35 +259,3 @@ let allExports = [ if (ENV._ENABLE_PROPERTY_REQUIRED_SUPPORT) { allExports.push(['required', 'ember-metal']); } - -allExports.forEach(reexport => { - let [path, moduleId, exportName] = reexport; - - // default path === exportName if none present - if (!exportName) { - exportName = path; - } - - QUnit.test(`Ember.${path} exports correctly`, assert => { - confirmExport(Ember, assert, path, moduleId, exportName); - }); -}); - -QUnit.test('Ember.String.isHTMLSafe exports correctly', function(assert) { - confirmExport(Ember, assert, 'String.isHTMLSafe', 'ember-glimmer', 'isHTMLSafe'); -}); - -if (DEBUG) { - QUnit.test('Ember.MODEL_FACTORY_INJECTIONS', function(assert) { - let descriptor = Object.getOwnPropertyDescriptor(Ember, 'MODEL_FACTORY_INJECTIONS'); - assert.equal(descriptor.enumerable, false, 'descriptor is not enumerable'); - assert.equal(descriptor.configurable, false, 'descriptor is not configurable'); - - assert.equal(Ember.MODEL_FACTORY_INJECTIONS, false); - - expectDeprecation(function() { - Ember.MODEL_FACTORY_INJECTIONS = true; - }, 'Ember.MODEL_FACTORY_INJECTIONS is no longer required'); - assert.equal(Ember.MODEL_FACTORY_INJECTIONS, false, 'writing to the property has no affect'); - }); -}