dist/ember-testing.js in ember-source-2.14.1 vs dist/ember-testing.js in ember-source-2.15.0.beta.1
- old
+ new
@@ -4,11 +4,11 @@
* @copyright Copyright 2011-2017 Tilde Inc. and contributors
* Portions Copyright 2006-2011 Strobe Inc.
* Portions Copyright 2008-2011 Apple Inc. All rights reserved.
* @license Licensed under MIT license
* See https://raw.github.com/emberjs/ember.js/master/LICENSE
- * @version 2.14.1
+ * @version 2.15.0-beta.1
*/
var enifed, requireModule, Ember;
var mainContext = this; // Used in ember-environment/lib/global.js
@@ -176,11 +176,11 @@
return obj;
}
var possibleConstructorReturn = exports.possibleConstructorReturn = function (self, call) {
if (!self) {
- throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
+ throw new ReferenceError('this hasn\'t been initialized - super() hasn\'t been called');
}
return call && (typeof call === 'object' || typeof call === 'function') ? call : self;
};
var slice = exports.slice = Array.prototype.slice;
@@ -196,11 +196,11 @@
@submodule ember-debug
*/
/**
Allows for runtime registration of handler functions that override the default deprecation behavior.
- Deprecations are invoked by calls to [Ember.deprecate](http://emberjs.com/api/classes/Ember.html#method_deprecate).
+ Deprecations are invoked by calls to [Ember.deprecate](https://emberjs.com/api/classes/Ember.html#method_deprecate).
The following example demonstrates its usage by registering a handler that throws an error if the
message contains the word "should", otherwise defers to the default handler.
```javascript
Ember.Debug.registerDeprecationHandler((message, options, next) => {
@@ -226,11 +226,10 @@
</ul>
@public
@static
@method registerDeprecationHandler
- @for Ember.Debug
@param handler {Function} A function to handle deprecation calls.
@since 2.1.0
*/
var registerHandler = function () {}; /*global __fail__*/
@@ -345,27 +344,27 @@
deprecate = function deprecate(message, test, options) {
if (!options || !options.id && !options.until) {
deprecate(missingOptionsDeprecation, false, {
id: 'ember-debug.deprecate-options-missing',
until: '3.0.0',
- url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options'
+ url: 'https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options'
});
}
if (options && !options.id) {
deprecate(missingOptionsIdDeprecation, false, {
id: 'ember-debug.deprecate-id-missing',
until: '3.0.0',
- url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options'
+ url: 'https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options'
});
}
if (options && !options.until) {
deprecate(missingOptionsUntilDeprecation, options && options.until, {
id: 'ember-debug.deprecate-until-missing',
until: '3.0.0',
- url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options'
+ url: 'https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options'
});
}
_handlers.invoke.apply(undefined, ['deprecate'].concat(Array.prototype.slice.call(arguments)));
};
@@ -564,26 +563,27 @@
var DEFAULT_FEATURES = _features2.DEFAULT_FEATURES,
FEATURES = _features2.FEATURES;
// These are the default production build versions:
- var assert = function () {};
- var info = function () {};
- var warn = function () {};
- var debug = function () {};
- var deprecate = function () {};
- var debugSeal = function () {};
- var debugFreeze = function () {};
- var runInDebug = function () {};
+ var noop = function () {};
+ var assert = noop;
+ var info = noop;
+ var warn = noop;
+ var debug = noop;
+ var deprecate = noop;
+ var debugSeal = noop;
+ var debugFreeze = noop;
+ var runInDebug = noop;
+ var setDebugFunction = noop;
+ var getDebugFunction = noop;
+
var deprecateFunc = function () {
return arguments[arguments.length - 1];
};
- var setDebugFunction = function () {};
- var getDebugFunction = function () {};
-
if (true) {
exports.setDebugFunction = setDebugFunction = function (type, callback) {
switch (type) {
case 'assert':
return exports.assert = assert = callback;
@@ -870,11 +870,11 @@
*/
if (true) {
/**
Allows for runtime registration of handler functions that override the default warning behavior.
- Warnings are invoked by calls made to [Ember.warn](http://emberjs.com/api/classes/Ember.html#method_warn).
+ Warnings are invoked by calls made to [Ember.warn](https://emberjs.com/api/classes/Ember.html#method_warn).
The following example demonstrates its usage by registering a handler that does nothing overriding Ember's
default warning behavior.
```javascript
// next is not called, so no warnings get the default behavior
Ember.Debug.registerWarnHandler(() => {});
@@ -889,11 +889,10 @@
<li> <code>next</code> - A function that calls into the previously registered handler.</li>
</ul>
@public
@static
@method registerWarnHandler
- @for Ember.Debug
@param handler {Function} A function to handle warnings.
@since 2.1.0
*/
exports.registerHandler = registerHandler = function registerHandler(handler) {
(0, _handlers.registerHandler)('warn', handler);
@@ -932,19 +931,19 @@
}
if (!options) {
(0, _deprecate.default)(missingOptionsDeprecation, false, {
id: 'ember-debug.warn-options-missing',
until: '3.0.0',
- url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options'
+ url: 'https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options'
});
}
if (options && !options.id) {
(0, _deprecate.default)(missingOptionsIdDeprecation, false, {
id: 'ember-debug.warn-id-missing',
until: '3.0.0',
- url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options'
+ url: 'https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options'
});
}
(0, _handlers.invoke)('warn', message, test, options);
};
@@ -1167,11 +1166,11 @@
setupForTesting: function () {
(0, _setup_for_testing.default)();
this.testing = true;
- this.Router.reopen({
+ this.resolveRegistration('router:main').reopen({
location: 'none'
});
},
@@ -1404,17 +1403,20 @@
exports.default = currentRouteName;
/**
Returns the currently active route name.
+
Example:
+
```javascript
function validateRouteName() {
equal(currentRouteName(), 'some.path', "correct route was transitioned into.");
}
visit('/some/path').then(validateRouteName)
```
+
@method currentRouteName
@return {Object} The name of the currently active route.
@since 1.5.0
@public
*/
@@ -1484,11 +1486,11 @@
*/
function fillIn(app, selector, contextOrText, text) {
var $el = void 0,
el = void 0,
context = void 0;
- if (typeof text === 'undefined') {
+ if (text === undefined) {
text = contextOrText;
} else {
context = contextOrText;
}
$el = app.testHelpers.findWithAssert(selector, context);
@@ -1582,12 +1584,12 @@
throw new Error('Element ' + selector + ' not found.');
}
return $el;
}
});
-enifed('ember-testing/helpers/key_event', ['exports'], function (exports) {
- 'use strict';
+enifed("ember-testing/helpers/key_event", ["exports"], function (exports) {
+ "use strict";
exports.default = keyEvent;
/**
@module ember
@submodule ember-testing
@@ -1610,11 +1612,11 @@
*/
function keyEvent(app, selector, contextOrType, typeOrKeyCode, keyCode) {
var context = void 0,
type = void 0;
- if (typeof keyCode === 'undefined') {
+ if (keyCode === undefined) {
context = null;
keyCode = typeOrKeyCode;
type = contextOrType;
} else {
context = contextOrType;
@@ -2068,14 +2070,10 @@
Object.defineProperty(Test, 'adapter', {
get: _adapter.getAdapter,
set: _adapter.setAdapter
});
- Object.defineProperty(Test, 'waiters', {
- get: _waiters.generateDeprecatedWaitersArray
- });
-
exports.default = Test;
});
enifed('ember-testing/test/adapter', ['exports', 'ember-console', 'ember-metal'], function (exports, _emberConsole, _emberMetal) {
'use strict';
@@ -2423,11 +2421,10 @@
'use strict';
exports.registerWaiter = registerWaiter;
exports.unregisterWaiter = unregisterWaiter;
exports.checkWaiters = checkWaiters;
- exports.generateDeprecatedWaitersArray = generateDeprecatedWaitersArray;
var contexts = [];
var callbacks = [];
@@ -2533,24 +2530,9 @@
if (callbacks[i] === callback && contexts[i] === context) {
return i;
}
}
return -1;
- }
-
- function generateDeprecatedWaitersArray() {
- (true && !(false) && (0, _emberDebug.deprecate)('Usage of `Ember.Test.waiters` is deprecated. Please refactor to `Ember.Test.checkWaiters`.', false, { until: '2.8.0', id: 'ember-testing.test-waiters' }));
-
-
- var array = new Array(callbacks.length);
- for (var i = 0; i < callbacks.length; i++) {
- var context = contexts[i];
- var callback = callbacks[i];
-
- array[i] = [context, callback];
- }
-
- return array;
}
});
enifed('node-module', ['exports'], function(_exports) {
var IS_NODE = typeof module === 'object' && typeof module.require === 'function';
if (IS_NODE) {