dist/ember-testing.js in ember-source-1.13.0.beta.1 vs dist/ember-testing.js in ember-source-1.13.0.beta.2

- old
+ new

@@ -3,11 +3,11 @@ * @copyright Copyright 2011-2015 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 1.13.0-beta.1 + * @version 1.13.0-beta.2 */ (function() { var enifed, requireModule, eriuqer, requirejs, Ember; var mainContext = this; @@ -114,20 +114,10 @@ 'use strict'; exports._warnIfUsingStrippedFeatureFlags = _warnIfUsingStrippedFeatureFlags; - /** - Will call `Ember.warn()` if ENABLE_ALL_FEATURES, ENABLE_OPTIONAL_FEATURES, or - any specific FEATURES flag is truthy. - - This method is called automatically in debug canary builds. - - @private - @method _warnIfUsingStrippedFeatureFlags - @return {void} - */ function isPlainFunction(test) { return typeof test === "function" && test.PrototypeMixin === undefined; } /** @@ -307,10 +297,21 @@ @since 1.5.0 */ Ember['default'].runInDebug = function (func) { func(); }; + + /** + Will call `Ember.warn()` if ENABLE_ALL_FEATURES, ENABLE_OPTIONAL_FEATURES, or + any specific FEATURES flag is truthy. + + This method is called automatically in debug canary builds. + + @private + @method _warnIfUsingStrippedFeatureFlags + @return {void} + */ function _warnIfUsingStrippedFeatureFlags(FEATURES, featuresWereStripped) { if (featuresWereStripped) { Ember['default'].warn("Ember.ENV.ENABLE_ALL_FEATURES is only available in canary builds.", !Ember['default'].ENV.ENABLE_ALL_FEATURES); Ember['default'].warn("Ember.ENV.ENABLE_OPTIONAL_FEATURES is only available in canary builds.", !Ember['default'].ENV.ENABLE_OPTIONAL_FEATURES); @@ -502,17 +503,19 @@ } } function visit(app, url) { var router = app.__container__.lookup("router:main"); + app.boot().then(function () { + router.location.setURL(url); + }); if (app._readinessDeferrals > 0) { router["initialURL"] = url; run['default'](app, "advanceReadiness"); delete router["initialURL"]; } else { - router.location.setURL(url); run['default'](app.__deprecatedInstance__, "handleURL", url); } return app.testHelpers.wait(); } @@ -944,22 +947,10 @@ enifed('ember-testing/setup_for_testing', ['exports', 'ember-metal/core', 'ember-testing/adapters/qunit', 'ember-views/system/jquery'], function (exports, Ember, QUnitAdapter, jQuery) { 'use strict'; - - /** - Sets Ember up for testing. This is useful to perform - basic setup steps in order to unit test. - - Use `App.setupForTesting` to perform integration tests (full - application testing). - - @method setupForTesting - @namespace Ember - @since 1.5.0 - */ exports['default'] = setupForTesting; var Test, requests; function incrementAjaxPendingRequests(_, xhr) { requests.push(xhr); @@ -972,10 +963,22 @@ requests.splice(i, 1); } } Test.pendingAjaxRequests = requests.length; } + + /** + Sets Ember up for testing. This is useful to perform + basic setup steps in order to unit test. + + Use `App.setupForTesting` to perform integration tests (full + application testing). + + @method setupForTesting + @namespace Ember + @since 1.5.0 + */ function setupForTesting() { if (!Test) { Test = requireModule("ember-testing/test")["default"]; } @@ -1185,12 +1188,14 @@ callback in the last chained then. This method should be returned by async helpers such as `wait`. @public @method promise @param {Function} resolver The function used to resolve the promise. + @param {String} label An optional string for identifying the promise. */ - promise: function (resolver) { - return new Test.Promise(resolver); + promise: function (resolver, label) { + var fullLabel = "Ember.Test.promise: " + (label || "<Unknown Promise>"); + return new Test.Promise(resolver, fullLabel); }, /** Used to allow ember-testing to communicate with a specific testing framework. \ No newline at end of file