ember-source 2.13.4 → 2.14.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/dist/ember-runtime.js +7250 -18493
- data/dist/ember-template-compiler.js +11820 -11420
- data/dist/ember-testing.js +1108 -384
- data/dist/ember-tests.js +18076 -19076
- data/dist/ember-tests.prod.js +19566 -24143
- data/dist/ember.debug.js +36827 -34371
- data/dist/ember.min.js +2479 -2979
- data/dist/ember.prod.js +39796 -39415
- metadata +5 -6
- data/dist/ember.js +0 -52203
data/dist/ember-testing.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
(function() {
|
2
2
|
/*!
|
3
3
|
* @overview Ember - JavaScript Application Framework
|
4
4
|
* @copyright Copyright 2011-2017 Tilde Inc. and contributors
|
@@ -6,7 +6,7 @@
|
|
6
6
|
* Portions Copyright 2008-2011 Apple Inc. All rights reserved.
|
7
7
|
* @license Licensed under MIT license
|
8
8
|
* See https://raw.github.com/emberjs/ember.js/master/LICENSE
|
9
|
-
* @version 2.
|
9
|
+
* @version 2.14.0-beta.1
|
10
10
|
*/
|
11
11
|
|
12
12
|
var enifed, requireModule, Ember;
|
@@ -94,96 +94,867 @@ var mainContext = this; // Used in ember-environment/lib/global.js
|
|
94
94
|
}
|
95
95
|
}
|
96
96
|
|
97
|
-
callback.apply(this, reified);
|
97
|
+
callback.apply(this, reified);
|
98
|
+
|
99
|
+
return exports;
|
100
|
+
}
|
101
|
+
|
102
|
+
requireModule._eak_seen = registry;
|
103
|
+
|
104
|
+
Ember.__loader = {
|
105
|
+
define: enifed,
|
106
|
+
require: requireModule,
|
107
|
+
registry: registry
|
108
|
+
};
|
109
|
+
} else {
|
110
|
+
enifed = Ember.__loader.define;
|
111
|
+
requireModule = Ember.__loader.require;
|
112
|
+
}
|
113
|
+
})();
|
114
|
+
|
115
|
+
enifed('ember-babel', ['exports'], function (exports) {
|
116
|
+
'use strict';
|
117
|
+
|
118
|
+
exports.classCallCheck = classCallCheck;
|
119
|
+
exports.inherits = inherits;
|
120
|
+
exports.taggedTemplateLiteralLoose = taggedTemplateLiteralLoose;
|
121
|
+
exports.createClass = createClass;
|
122
|
+
exports.defaults = defaults;
|
123
|
+
function classCallCheck(instance, Constructor) {
|
124
|
+
if (!(instance instanceof Constructor)) {
|
125
|
+
throw new TypeError('Cannot call a class as a function');
|
126
|
+
}
|
127
|
+
}
|
128
|
+
|
129
|
+
function inherits(subClass, superClass) {
|
130
|
+
if (typeof superClass !== 'function' && superClass !== null) {
|
131
|
+
throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass);
|
132
|
+
}
|
133
|
+
|
134
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
135
|
+
constructor: {
|
136
|
+
value: subClass,
|
137
|
+
enumerable: false,
|
138
|
+
writable: true,
|
139
|
+
configurable: true
|
140
|
+
}
|
141
|
+
});
|
142
|
+
|
143
|
+
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : defaults(subClass, superClass);
|
144
|
+
}
|
145
|
+
|
146
|
+
function taggedTemplateLiteralLoose(strings, raw) {
|
147
|
+
strings.raw = raw;
|
148
|
+
return strings;
|
149
|
+
}
|
150
|
+
|
151
|
+
function defineProperties(target, props) {
|
152
|
+
for (var i = 0; i < props.length; i++) {
|
153
|
+
var descriptor = props[i];
|
154
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
155
|
+
descriptor.configurable = true;
|
156
|
+
if ('value' in descriptor) descriptor.writable = true;
|
157
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
158
|
+
}
|
159
|
+
}
|
160
|
+
|
161
|
+
function createClass(Constructor, protoProps, staticProps) {
|
162
|
+
if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
163
|
+
if (staticProps) defineProperties(Constructor, staticProps);
|
164
|
+
return Constructor;
|
165
|
+
}
|
166
|
+
|
167
|
+
function defaults(obj, defaults) {
|
168
|
+
var keys = Object.getOwnPropertyNames(defaults);
|
169
|
+
for (var i = 0; i < keys.length; i++) {
|
170
|
+
var key = keys[i];
|
171
|
+
var value = Object.getOwnPropertyDescriptor(defaults, key);
|
172
|
+
if (value && value.configurable && obj[key] === undefined) {
|
173
|
+
Object.defineProperty(obj, key, value);
|
174
|
+
}
|
175
|
+
}
|
176
|
+
return obj;
|
177
|
+
}
|
178
|
+
|
179
|
+
var possibleConstructorReturn = exports.possibleConstructorReturn = function (self, call) {
|
180
|
+
if (!self) {
|
181
|
+
throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
|
182
|
+
}
|
183
|
+
return call && (typeof call === 'object' || typeof call === 'function') ? call : self;
|
184
|
+
};
|
185
|
+
|
186
|
+
var slice = exports.slice = Array.prototype.slice;
|
187
|
+
});
|
188
|
+
enifed('ember-debug/deprecate', ['exports', 'ember-debug/error', 'ember-console', 'ember-environment', 'ember-debug/handlers'], function (exports, _error, _emberConsole, _emberEnvironment, _handlers) {
|
189
|
+
'use strict';
|
190
|
+
|
191
|
+
exports.missingOptionsUntilDeprecation = exports.missingOptionsIdDeprecation = exports.missingOptionsDeprecation = undefined;
|
192
|
+
exports.registerHandler = registerHandler;
|
193
|
+
exports.default = deprecate;
|
194
|
+
|
195
|
+
|
196
|
+
/**
|
197
|
+
Allows for runtime registration of handler functions that override the default deprecation behavior.
|
198
|
+
Deprecations are invoked by calls to [Ember.deprecate](http://emberjs.com/api/classes/Ember.html#method_deprecate).
|
199
|
+
The following example demonstrates its usage by registering a handler that throws an error if the
|
200
|
+
message contains the word "should", otherwise defers to the default handler.
|
201
|
+
|
202
|
+
```javascript
|
203
|
+
Ember.Debug.registerDeprecationHandler((message, options, next) => {
|
204
|
+
if (message.indexOf('should') !== -1) {
|
205
|
+
throw new Error(`Deprecation message with should: ${message}`);
|
206
|
+
} else {
|
207
|
+
// defer to whatever handler was registered before this one
|
208
|
+
next(message, options);
|
209
|
+
}
|
210
|
+
});
|
211
|
+
```
|
212
|
+
|
213
|
+
The handler function takes the following arguments:
|
214
|
+
|
215
|
+
<ul>
|
216
|
+
<li> <code>message</code> - The message received from the deprecation call.</li>
|
217
|
+
<li> <code>options</code> - An object passed in with the deprecation call containing additional information including:</li>
|
218
|
+
<ul>
|
219
|
+
<li> <code>id</code> - An id of the deprecation in the form of <code>package-name.specific-deprecation</code>.</li>
|
220
|
+
<li> <code>until</code> - The Ember version number the feature and deprecation will be removed in.</li>
|
221
|
+
</ul>
|
222
|
+
<li> <code>next</code> - A function that calls into the previously registered handler.</li>
|
223
|
+
</ul>
|
224
|
+
|
225
|
+
@public
|
226
|
+
@static
|
227
|
+
@method registerDeprecationHandler
|
228
|
+
@param handler {Function} A function to handle deprecation calls.
|
229
|
+
@since 2.1.0
|
230
|
+
*/
|
231
|
+
/*global __fail__*/
|
232
|
+
|
233
|
+
function registerHandler(handler) {
|
234
|
+
(0, _handlers.registerHandler)('deprecate', handler);
|
235
|
+
}
|
236
|
+
|
237
|
+
function formatMessage(_message, options) {
|
238
|
+
var message = _message;
|
239
|
+
|
240
|
+
if (options && options.id) {
|
241
|
+
message = message + (' [deprecation id: ' + options.id + ']');
|
242
|
+
}
|
243
|
+
|
244
|
+
if (options && options.url) {
|
245
|
+
message += ' See ' + options.url + ' for more details.';
|
246
|
+
}
|
247
|
+
|
248
|
+
return message;
|
249
|
+
}
|
250
|
+
|
251
|
+
registerHandler(function logDeprecationToConsole(message, options) {
|
252
|
+
var updatedMessage = formatMessage(message, options);
|
253
|
+
|
254
|
+
_emberConsole.default.warn('DEPRECATION: ' + updatedMessage);
|
255
|
+
});
|
256
|
+
|
257
|
+
var captureErrorForStack = void 0;
|
258
|
+
|
259
|
+
if (new Error().stack) {
|
260
|
+
captureErrorForStack = function () {
|
261
|
+
return new Error();
|
262
|
+
};
|
263
|
+
} else {
|
264
|
+
captureErrorForStack = function () {
|
265
|
+
try {
|
266
|
+
__fail__.fail();
|
267
|
+
} catch (e) {
|
268
|
+
return e;
|
269
|
+
}
|
270
|
+
};
|
271
|
+
}
|
272
|
+
|
273
|
+
registerHandler(function logDeprecationStackTrace(message, options, next) {
|
274
|
+
if (_emberEnvironment.ENV.LOG_STACKTRACE_ON_DEPRECATION) {
|
275
|
+
var stackStr = '';
|
276
|
+
var error = captureErrorForStack();
|
277
|
+
var stack = void 0;
|
278
|
+
|
279
|
+
if (error.stack) {
|
280
|
+
if (error['arguments']) {
|
281
|
+
// Chrome
|
282
|
+
stack = error.stack.replace(/^\s+at\s+/gm, '').replace(/^([^\(]+?)([\n$])/gm, '{anonymous}($1)$2').replace(/^Object.<anonymous>\s*\(([^\)]+)\)/gm, '{anonymous}($1)').split('\n');
|
283
|
+
stack.shift();
|
284
|
+
} else {
|
285
|
+
// Firefox
|
286
|
+
stack = error.stack.replace(/(?:\n@:0)?\s+$/m, '').replace(/^\(/gm, '{anonymous}(').split('\n');
|
287
|
+
}
|
288
|
+
|
289
|
+
stackStr = '\n ' + stack.slice(2).join('\n ');
|
290
|
+
}
|
291
|
+
|
292
|
+
var updatedMessage = formatMessage(message, options);
|
293
|
+
|
294
|
+
_emberConsole.default.warn('DEPRECATION: ' + updatedMessage + stackStr);
|
295
|
+
} else {
|
296
|
+
next.apply(undefined, arguments);
|
297
|
+
}
|
298
|
+
});
|
299
|
+
|
300
|
+
registerHandler(function raiseOnDeprecation(message, options, next) {
|
301
|
+
if (_emberEnvironment.ENV.RAISE_ON_DEPRECATION) {
|
302
|
+
var updatedMessage = formatMessage(message);
|
303
|
+
|
304
|
+
throw new _error.default(updatedMessage);
|
305
|
+
} else {
|
306
|
+
next.apply(undefined, arguments);
|
307
|
+
}
|
308
|
+
});
|
309
|
+
|
310
|
+
var missingOptionsDeprecation = exports.missingOptionsDeprecation = 'When calling `Ember.deprecate` you ' + 'must provide an `options` hash as the third parameter. ' + '`options` should include `id` and `until` properties.';
|
311
|
+
var missingOptionsIdDeprecation = exports.missingOptionsIdDeprecation = 'When calling `Ember.deprecate` you must provide `id` in options.';
|
312
|
+
var missingOptionsUntilDeprecation = exports.missingOptionsUntilDeprecation = 'When calling `Ember.deprecate` you must provide `until` in options.';
|
313
|
+
|
314
|
+
/**
|
315
|
+
@module ember
|
316
|
+
@submodule ember-debug
|
317
|
+
*/
|
318
|
+
|
319
|
+
/**
|
320
|
+
Display a deprecation warning with the provided message and a stack trace
|
321
|
+
(Chrome and Firefox only).
|
322
|
+
|
323
|
+
* In a production build, this method is defined as an empty function (NOP).
|
324
|
+
Uses of this method in Ember itself are stripped from the ember.prod.js build.
|
325
|
+
|
326
|
+
@method deprecate
|
327
|
+
@param {String} message A description of the deprecation.
|
328
|
+
@param {Boolean} test A boolean. If falsy, the deprecation will be displayed.
|
329
|
+
@param {Object} options
|
330
|
+
@param {String} options.id A unique id for this deprecation. The id can be
|
331
|
+
used by Ember debugging tools to change the behavior (raise, log or silence)
|
332
|
+
for that specific deprecation. The id should be namespaced by dots, e.g.
|
333
|
+
"view.helper.select".
|
334
|
+
@param {string} options.until The version of Ember when this deprecation
|
335
|
+
warning will be removed.
|
336
|
+
@param {String} [options.url] An optional url to the transition guide on the
|
337
|
+
emberjs.com website.
|
338
|
+
@for Ember
|
339
|
+
@public
|
340
|
+
@since 1.0.0
|
341
|
+
*/
|
342
|
+
function deprecate(message, test, options) {
|
343
|
+
if (!options || !options.id && !options.until) {
|
344
|
+
deprecate(missingOptionsDeprecation, false, {
|
345
|
+
id: 'ember-debug.deprecate-options-missing',
|
346
|
+
until: '3.0.0',
|
347
|
+
url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options'
|
348
|
+
});
|
349
|
+
}
|
350
|
+
|
351
|
+
if (options && !options.id) {
|
352
|
+
deprecate(missingOptionsIdDeprecation, false, {
|
353
|
+
id: 'ember-debug.deprecate-id-missing',
|
354
|
+
until: '3.0.0',
|
355
|
+
url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options'
|
356
|
+
});
|
357
|
+
}
|
358
|
+
|
359
|
+
if (options && !options.until) {
|
360
|
+
deprecate(missingOptionsUntilDeprecation, options && options.until, {
|
361
|
+
id: 'ember-debug.deprecate-until-missing',
|
362
|
+
until: '3.0.0',
|
363
|
+
url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options'
|
364
|
+
});
|
365
|
+
}
|
366
|
+
|
367
|
+
_handlers.invoke.apply(undefined, ['deprecate'].concat(Array.prototype.slice.call(arguments)));
|
368
|
+
}
|
369
|
+
});
|
370
|
+
enifed("ember-debug/error", ["exports", "ember-babel"], function (exports, _emberBabel) {
|
371
|
+
"use strict";
|
372
|
+
|
373
|
+
function ExtendBuiltin(klass) {
|
374
|
+
function ExtendableBuiltin() {
|
375
|
+
klass.apply(this, arguments);
|
376
|
+
}
|
377
|
+
|
378
|
+
ExtendableBuiltin.prototype = Object.create(klass.prototype);
|
379
|
+
ExtendableBuiltin.prototype.constructor = ExtendableBuiltin;
|
380
|
+
return ExtendableBuiltin;
|
381
|
+
}
|
382
|
+
|
383
|
+
/**
|
384
|
+
A subclass of the JavaScript Error object for use in Ember.
|
385
|
+
|
386
|
+
@class Error
|
387
|
+
@namespace Ember
|
388
|
+
@extends Error
|
389
|
+
@constructor
|
390
|
+
@public
|
391
|
+
*/
|
392
|
+
|
393
|
+
var EmberError = function (_ExtendBuiltin) {
|
394
|
+
(0, _emberBabel.inherits)(EmberError, _ExtendBuiltin);
|
395
|
+
|
396
|
+
function EmberError(message) {
|
397
|
+
(0, _emberBabel.classCallCheck)(this, EmberError);
|
398
|
+
|
399
|
+
var _this = (0, _emberBabel.possibleConstructorReturn)(this, _ExtendBuiltin.call(this));
|
400
|
+
|
401
|
+
if (!(_this instanceof EmberError)) {
|
402
|
+
var _ret;
|
403
|
+
|
404
|
+
return _ret = new EmberError(message), (0, _emberBabel.possibleConstructorReturn)(_this, _ret);
|
405
|
+
}
|
406
|
+
|
407
|
+
var error = Error.call(_this, message);
|
408
|
+
|
409
|
+
if (Error.captureStackTrace) {
|
410
|
+
Error.captureStackTrace(_this, EmberError);
|
411
|
+
} else {
|
412
|
+
_this.stack = error.stack;
|
413
|
+
}
|
414
|
+
|
415
|
+
_this.description = error.description;
|
416
|
+
_this.fileName = error.fileName;
|
417
|
+
_this.lineNumber = error.lineNumber;
|
418
|
+
_this.message = error.message;
|
419
|
+
_this.name = error.name;
|
420
|
+
_this.number = error.number;
|
421
|
+
_this.code = error.code;
|
422
|
+
return _this;
|
423
|
+
}
|
424
|
+
|
425
|
+
return EmberError;
|
426
|
+
}(ExtendBuiltin(Error));
|
427
|
+
|
428
|
+
exports.default = EmberError;
|
429
|
+
});
|
430
|
+
enifed('ember-debug/features', ['exports', 'ember-environment', 'ember/features'], function (exports, _emberEnvironment, _features) {
|
431
|
+
'use strict';
|
432
|
+
|
433
|
+
exports.default = isEnabled;
|
434
|
+
var FEATURES = _features.FEATURES;
|
435
|
+
|
436
|
+
|
437
|
+
/**
|
438
|
+
The hash of enabled Canary features. Add to this, any canary features
|
439
|
+
before creating your application.
|
440
|
+
|
441
|
+
Alternatively (and recommended), you can also define `EmberENV.FEATURES`
|
442
|
+
if you need to enable features flagged at runtime.
|
443
|
+
|
444
|
+
@class FEATURES
|
445
|
+
@namespace Ember
|
446
|
+
@static
|
447
|
+
@since 1.1.0
|
448
|
+
@public
|
449
|
+
*/
|
450
|
+
|
451
|
+
// Auto-generated
|
452
|
+
|
453
|
+
/**
|
454
|
+
Determine whether the specified `feature` is enabled. Used by Ember's
|
455
|
+
build tools to exclude experimental features from beta/stable builds.
|
456
|
+
|
457
|
+
You can define the following configuration options:
|
458
|
+
|
459
|
+
* `EmberENV.ENABLE_OPTIONAL_FEATURES` - enable any features that have not been explicitly
|
460
|
+
enabled/disabled.
|
461
|
+
|
462
|
+
@method isEnabled
|
463
|
+
@param {String} feature The feature to check
|
464
|
+
@return {Boolean}
|
465
|
+
@for Ember.FEATURES
|
466
|
+
@since 1.1.0
|
467
|
+
@public
|
468
|
+
*/
|
469
|
+
function isEnabled(feature) {
|
470
|
+
var featureValue = FEATURES[feature];
|
471
|
+
|
472
|
+
if (featureValue === true || featureValue === false || featureValue === undefined) {
|
473
|
+
return featureValue;
|
474
|
+
} else if (_emberEnvironment.ENV.ENABLE_OPTIONAL_FEATURES) {
|
475
|
+
return true;
|
476
|
+
} else {
|
477
|
+
return false;
|
478
|
+
}
|
479
|
+
}
|
480
|
+
});
|
481
|
+
enifed("ember-debug/handlers", ["exports"], function (exports) {
|
482
|
+
"use strict";
|
483
|
+
|
484
|
+
exports.registerHandler = registerHandler;
|
485
|
+
exports.invoke = invoke;
|
486
|
+
var HANDLERS = exports.HANDLERS = {};
|
487
|
+
|
488
|
+
function registerHandler(type, callback) {
|
489
|
+
var nextHandler = HANDLERS[type] || function () {};
|
490
|
+
|
491
|
+
HANDLERS[type] = function (message, options) {
|
492
|
+
callback(message, options, nextHandler);
|
493
|
+
};
|
494
|
+
}
|
495
|
+
|
496
|
+
function invoke(type, message, test, options) {
|
497
|
+
if (test) {
|
498
|
+
return;
|
499
|
+
}
|
500
|
+
|
501
|
+
var handlerForType = HANDLERS[type];
|
502
|
+
|
503
|
+
if (handlerForType) {
|
504
|
+
handlerForType(message, options);
|
505
|
+
}
|
506
|
+
}
|
507
|
+
});
|
508
|
+
enifed('ember-debug/index', ['exports', 'ember-debug/warn', 'ember-debug/deprecate', 'ember-debug/features', 'ember-debug/error', 'ember-debug/testing', 'ember-environment', 'ember-console', 'ember/features'], function (exports, _warn2, _deprecate2, _features, _error, _testing, _emberEnvironment, _emberConsole, _features2) {
|
509
|
+
'use strict';
|
510
|
+
|
511
|
+
exports.runningNonEmberDebugJS = exports.debugFunctions = exports.setTesting = exports.isTesting = exports.Error = exports.isFeatureEnabled = exports.registerDeprecationHandler = exports.registerWarnHandler = undefined;
|
512
|
+
Object.defineProperty(exports, 'registerWarnHandler', {
|
513
|
+
enumerable: true,
|
514
|
+
get: function () {
|
515
|
+
return _warn2.registerHandler;
|
516
|
+
}
|
517
|
+
});
|
518
|
+
Object.defineProperty(exports, 'registerDeprecationHandler', {
|
519
|
+
enumerable: true,
|
520
|
+
get: function () {
|
521
|
+
return _deprecate2.registerHandler;
|
522
|
+
}
|
523
|
+
});
|
524
|
+
Object.defineProperty(exports, 'isFeatureEnabled', {
|
525
|
+
enumerable: true,
|
526
|
+
get: function () {
|
527
|
+
return _features.default;
|
528
|
+
}
|
529
|
+
});
|
530
|
+
Object.defineProperty(exports, 'Error', {
|
531
|
+
enumerable: true,
|
532
|
+
get: function () {
|
533
|
+
return _error.default;
|
534
|
+
}
|
535
|
+
});
|
536
|
+
Object.defineProperty(exports, 'isTesting', {
|
537
|
+
enumerable: true,
|
538
|
+
get: function () {
|
539
|
+
return _testing.isTesting;
|
540
|
+
}
|
541
|
+
});
|
542
|
+
Object.defineProperty(exports, 'setTesting', {
|
543
|
+
enumerable: true,
|
544
|
+
get: function () {
|
545
|
+
return _testing.setTesting;
|
546
|
+
}
|
547
|
+
});
|
548
|
+
exports._warnIfUsingStrippedFeatureFlags = _warnIfUsingStrippedFeatureFlags;
|
549
|
+
exports.getDebugFunction = getDebugFunction;
|
550
|
+
exports.setDebugFunction = setDebugFunction;
|
551
|
+
exports.assert = assert;
|
552
|
+
exports.info = info;
|
553
|
+
exports.warn = warn;
|
554
|
+
exports.debug = debug;
|
555
|
+
exports.deprecate = deprecate;
|
556
|
+
exports.deprecateFunc = deprecateFunc;
|
557
|
+
exports.runInDebug = runInDebug;
|
558
|
+
exports.debugSeal = debugSeal;
|
559
|
+
exports.debugFreeze = debugFreeze;
|
560
|
+
var DEFAULT_FEATURES = _features2.DEFAULT_FEATURES,
|
561
|
+
FEATURES = _features2.FEATURES;
|
562
|
+
var debugFunctions = exports.debugFunctions = {
|
563
|
+
assert: function () {},
|
564
|
+
info: function () {},
|
565
|
+
warn: function () {},
|
566
|
+
debug: function () {},
|
567
|
+
deprecate: function () {},
|
568
|
+
deprecateFunc: function () {
|
569
|
+
var _ref;
|
570
|
+
|
571
|
+
return _ref = arguments.length - 1, arguments.length <= _ref ? undefined : arguments[_ref];
|
572
|
+
},
|
573
|
+
debugSeal: function () {},
|
574
|
+
debugFreeze: function () {}
|
575
|
+
};
|
576
|
+
|
577
|
+
/**
|
578
|
+
@module ember
|
579
|
+
@submodule ember-debug
|
580
|
+
*/
|
581
|
+
|
582
|
+
/**
|
583
|
+
@class Ember
|
584
|
+
@public
|
585
|
+
*/
|
586
|
+
|
587
|
+
/**
|
588
|
+
Define an assertion that will throw an exception if the condition is not met.
|
589
|
+
|
590
|
+
* In a production build, this method is defined as an empty function (NOP).
|
591
|
+
Uses of this method in Ember itself are stripped from the ember.prod.js build.
|
592
|
+
|
593
|
+
```javascript
|
594
|
+
// Test for truthiness
|
595
|
+
Ember.assert('Must pass a valid object', obj);
|
596
|
+
|
597
|
+
// Fail unconditionally
|
598
|
+
Ember.assert('This code path should never be run');
|
599
|
+
```
|
600
|
+
|
601
|
+
@method assert
|
602
|
+
@param {String} desc A description of the assertion. This will become
|
603
|
+
the text of the Error thrown if the assertion fails.
|
604
|
+
@param {Boolean} test Must be truthy for the assertion to pass. If
|
605
|
+
falsy, an exception will be thrown.
|
606
|
+
@public
|
607
|
+
@since 1.0.0
|
608
|
+
*/
|
609
|
+
setDebugFunction('assert', function assert(desc, test) {
|
610
|
+
if (!test) {
|
611
|
+
throw new _error.default('Assertion Failed: ' + desc);
|
612
|
+
}
|
613
|
+
});
|
614
|
+
|
615
|
+
/**
|
616
|
+
Display a debug notice.
|
617
|
+
|
618
|
+
* In a production build, this method is defined as an empty function (NOP).
|
619
|
+
Uses of this method in Ember itself are stripped from the ember.prod.js build.
|
620
|
+
|
621
|
+
```javascript
|
622
|
+
Ember.debug('I\'m a debug notice!');
|
623
|
+
```
|
624
|
+
|
625
|
+
@method debug
|
626
|
+
@param {String} message A debug message to display.
|
627
|
+
@public
|
628
|
+
*/
|
629
|
+
setDebugFunction('debug', function debug(message) {
|
630
|
+
_emberConsole.default.debug('DEBUG: ' + message);
|
631
|
+
});
|
632
|
+
|
633
|
+
/**
|
634
|
+
Display an info notice.
|
635
|
+
|
636
|
+
* In a production build, this method is defined as an empty function (NOP).
|
637
|
+
Uses of this method in Ember itself are stripped from the ember.prod.js build.
|
638
|
+
|
639
|
+
@method info
|
640
|
+
@private
|
641
|
+
*/
|
642
|
+
setDebugFunction('info', function info() {
|
643
|
+
_emberConsole.default.info.apply(undefined, arguments);
|
644
|
+
});
|
645
|
+
|
646
|
+
/**
|
647
|
+
Alias an old, deprecated method with its new counterpart.
|
648
|
+
|
649
|
+
Display a deprecation warning with the provided message and a stack trace
|
650
|
+
(Chrome and Firefox only) when the assigned method is called.
|
651
|
+
|
652
|
+
* In a production build, this method is defined as an empty function (NOP).
|
653
|
+
|
654
|
+
```javascript
|
655
|
+
Ember.oldMethod = Ember.deprecateFunc('Please use the new, updated method', Ember.newMethod);
|
656
|
+
```
|
657
|
+
|
658
|
+
@method deprecateFunc
|
659
|
+
@param {String} message A description of the deprecation.
|
660
|
+
@param {Object} [options] The options object for Ember.deprecate.
|
661
|
+
@param {Function} func The new function called to replace its deprecated counterpart.
|
662
|
+
@return {Function} A new function that wraps the original function with a deprecation warning
|
663
|
+
@private
|
664
|
+
*/
|
665
|
+
setDebugFunction('deprecateFunc', function deprecateFunc() {
|
666
|
+
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
667
|
+
args[_key] = arguments[_key];
|
668
|
+
}
|
669
|
+
|
670
|
+
if (args.length === 3) {
|
671
|
+
var message = args[0],
|
672
|
+
options = args[1],
|
673
|
+
func = args[2];
|
674
|
+
|
675
|
+
return function () {
|
676
|
+
deprecate(message, false, options);
|
677
|
+
return func.apply(this, arguments);
|
678
|
+
};
|
679
|
+
} else {
|
680
|
+
var _message = args[0],
|
681
|
+
_func = args[1];
|
682
|
+
|
683
|
+
return function () {
|
684
|
+
deprecate(_message);
|
685
|
+
return _func.apply(this, arguments);
|
686
|
+
};
|
687
|
+
}
|
688
|
+
});
|
689
|
+
|
690
|
+
/**
|
691
|
+
Run a function meant for debugging.
|
692
|
+
|
693
|
+
* In a production build, this method is defined as an empty function (NOP).
|
694
|
+
Uses of this method in Ember itself are stripped from the ember.prod.js build.
|
695
|
+
|
696
|
+
```javascript
|
697
|
+
Ember.runInDebug(() => {
|
698
|
+
Ember.Component.reopen({
|
699
|
+
didInsertElement() {
|
700
|
+
console.log("I'm happy");
|
701
|
+
}
|
702
|
+
});
|
703
|
+
});
|
704
|
+
```
|
705
|
+
|
706
|
+
@method runInDebug
|
707
|
+
@param {Function} func The function to be executed.
|
708
|
+
@since 1.5.0
|
709
|
+
@public
|
710
|
+
*/
|
711
|
+
setDebugFunction('runInDebug', function runInDebug(func) {
|
712
|
+
func();
|
713
|
+
});
|
714
|
+
|
715
|
+
setDebugFunction('debugSeal', function debugSeal(obj) {
|
716
|
+
Object.seal(obj);
|
717
|
+
});
|
718
|
+
|
719
|
+
setDebugFunction('debugFreeze', function debugFreeze(obj) {
|
720
|
+
Object.freeze(obj);
|
721
|
+
});
|
722
|
+
|
723
|
+
setDebugFunction('deprecate', _deprecate2.default);
|
724
|
+
|
725
|
+
setDebugFunction('warn', _warn2.default);
|
726
|
+
|
727
|
+
/**
|
728
|
+
Will call `Ember.warn()` if ENABLE_OPTIONAL_FEATURES or
|
729
|
+
any specific FEATURES flag is truthy.
|
730
|
+
|
731
|
+
This method is called automatically in debug canary builds.
|
732
|
+
|
733
|
+
@private
|
734
|
+
@method _warnIfUsingStrippedFeatureFlags
|
735
|
+
@return {void}
|
736
|
+
*/
|
737
|
+
function _warnIfUsingStrippedFeatureFlags(FEATURES, knownFeatures, featuresWereStripped) {
|
738
|
+
if (featuresWereStripped) {
|
739
|
+
warn('Ember.ENV.ENABLE_OPTIONAL_FEATURES is only available in canary builds.', !_emberEnvironment.ENV.ENABLE_OPTIONAL_FEATURES, { id: 'ember-debug.feature-flag-with-features-stripped' });
|
740
|
+
|
741
|
+
var keys = Object.keys(FEATURES || {});
|
742
|
+
for (var i = 0; i < keys.length; i++) {
|
743
|
+
var key = keys[i];
|
744
|
+
if (key === 'isEnabled' || !(key in knownFeatures)) {
|
745
|
+
continue;
|
746
|
+
}
|
747
|
+
|
748
|
+
warn('FEATURE["' + key + '"] is set as enabled, but FEATURE flags are only available in canary builds.', !FEATURES[key], { id: 'ember-debug.feature-flag-with-features-stripped' });
|
749
|
+
}
|
750
|
+
}
|
751
|
+
}
|
752
|
+
|
753
|
+
if (!(0, _testing.isTesting)()) {
|
754
|
+
// Complain if they're using FEATURE flags in builds other than canary
|
755
|
+
FEATURES['features-stripped-test'] = true;
|
756
|
+
var featuresWereStripped = true;
|
757
|
+
|
758
|
+
if ((0, _features.default)('features-stripped-test')) {
|
759
|
+
featuresWereStripped = false;
|
760
|
+
}
|
761
|
+
|
762
|
+
delete FEATURES['features-stripped-test'];
|
763
|
+
_warnIfUsingStrippedFeatureFlags(_emberEnvironment.ENV.FEATURES, DEFAULT_FEATURES, featuresWereStripped);
|
764
|
+
|
765
|
+
// Inform the developer about the Ember Inspector if not installed.
|
766
|
+
var isFirefox = _emberEnvironment.environment.isFirefox;
|
767
|
+
var isChrome = _emberEnvironment.environment.isChrome;
|
768
|
+
|
769
|
+
if (typeof window !== 'undefined' && (isFirefox || isChrome) && window.addEventListener) {
|
770
|
+
window.addEventListener('load', function () {
|
771
|
+
if (document.documentElement && document.documentElement.dataset && !document.documentElement.dataset.emberExtension) {
|
772
|
+
var downloadURL = void 0;
|
773
|
+
|
774
|
+
if (isChrome) {
|
775
|
+
downloadURL = 'https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi';
|
776
|
+
} else if (isFirefox) {
|
777
|
+
downloadURL = 'https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/';
|
778
|
+
}
|
779
|
+
|
780
|
+
debug('For more advanced debugging, install the Ember Inspector from ' + downloadURL);
|
781
|
+
}
|
782
|
+
}, false);
|
783
|
+
}
|
784
|
+
}
|
785
|
+
|
786
|
+
/*
|
787
|
+
We are transitioning away from `ember.js` to `ember.debug.js` to make
|
788
|
+
it much clearer that it is only for local development purposes.
|
789
|
+
|
790
|
+
This flag value is changed by the tooling (by a simple string replacement)
|
791
|
+
so that if `ember.js` (which must be output for backwards compat reasons) is
|
792
|
+
used a nice helpful warning message will be printed out.
|
793
|
+
*/
|
794
|
+
var runningNonEmberDebugJS = exports.runningNonEmberDebugJS = false;
|
795
|
+
if (runningNonEmberDebugJS) {
|
796
|
+
warn('Please use `ember.debug.js` instead of `ember.js` for development and debugging.');
|
797
|
+
}
|
798
|
+
|
799
|
+
function getDebugFunction(name) {
|
800
|
+
return debugFunctions[name];
|
801
|
+
}
|
802
|
+
|
803
|
+
function setDebugFunction(name, fn) {
|
804
|
+
debugFunctions[name] = fn;
|
805
|
+
}
|
806
|
+
|
807
|
+
function assert() {
|
808
|
+
return debugFunctions.assert.apply(undefined, arguments);
|
809
|
+
}
|
810
|
+
|
811
|
+
function info() {
|
812
|
+
return debugFunctions.info.apply(undefined, arguments);
|
813
|
+
}
|
814
|
+
|
815
|
+
function warn() {
|
816
|
+
return debugFunctions.warn.apply(undefined, arguments);
|
817
|
+
}
|
818
|
+
|
819
|
+
function debug() {
|
820
|
+
return debugFunctions.debug.apply(undefined, arguments);
|
821
|
+
}
|
822
|
+
|
823
|
+
function deprecate() {
|
824
|
+
return debugFunctions.deprecate.apply(undefined, arguments);
|
825
|
+
}
|
98
826
|
|
99
|
-
|
100
|
-
|
827
|
+
function deprecateFunc() {
|
828
|
+
return debugFunctions.deprecateFunc.apply(undefined, arguments);
|
829
|
+
}
|
101
830
|
|
102
|
-
|
831
|
+
function runInDebug() {
|
832
|
+
return debugFunctions.runInDebug.apply(undefined, arguments);
|
833
|
+
}
|
103
834
|
|
104
|
-
|
105
|
-
|
106
|
-
require: requireModule,
|
107
|
-
registry: registry
|
108
|
-
};
|
109
|
-
} else {
|
110
|
-
enifed = Ember.__loader.define;
|
111
|
-
requireModule = Ember.__loader.require;
|
835
|
+
function debugSeal() {
|
836
|
+
return debugFunctions.debugSeal.apply(undefined, arguments);
|
112
837
|
}
|
113
|
-
})();
|
114
838
|
|
115
|
-
function
|
116
|
-
|
117
|
-
|
839
|
+
function debugFreeze() {
|
840
|
+
return debugFunctions.debugFreeze.apply(undefined, arguments);
|
841
|
+
}
|
842
|
+
});
|
843
|
+
enifed("ember-debug/run-in-debug", [], function () {
|
844
|
+
"use strict";
|
845
|
+
});
|
846
|
+
enifed("ember-debug/testing", ["exports"], function (exports) {
|
847
|
+
"use strict";
|
848
|
+
|
849
|
+
exports.isTesting = isTesting;
|
850
|
+
exports.setTesting = setTesting;
|
851
|
+
var testing = false;
|
852
|
+
|
853
|
+
function isTesting() {
|
854
|
+
return testing;
|
118
855
|
}
|
119
|
-
}
|
120
856
|
|
121
|
-
function
|
122
|
-
|
123
|
-
|
857
|
+
function setTesting(value) {
|
858
|
+
testing = !!value;
|
859
|
+
}
|
860
|
+
});
|
861
|
+
enifed('ember-debug/warn', ['exports', 'ember-console', 'ember-debug/deprecate', 'ember-debug/handlers'], function (exports, _emberConsole, _deprecate, _handlers) {
|
862
|
+
'use strict';
|
863
|
+
|
864
|
+
exports.missingOptionsIdDeprecation = exports.missingOptionsDeprecation = undefined;
|
865
|
+
exports.registerHandler = registerHandler;
|
866
|
+
exports.default = warn;
|
867
|
+
|
868
|
+
|
869
|
+
/**
|
870
|
+
Allows for runtime registration of handler functions that override the default warning behavior.
|
871
|
+
Warnings are invoked by calls made to [Ember.warn](http://emberjs.com/api/classes/Ember.html#method_warn).
|
872
|
+
The following example demonstrates its usage by registering a handler that does nothing overriding Ember's
|
873
|
+
default warning behavior.
|
874
|
+
|
875
|
+
```javascript
|
876
|
+
// next is not called, so no warnings get the default behavior
|
877
|
+
Ember.Debug.registerWarnHandler(() => {});
|
878
|
+
```
|
879
|
+
|
880
|
+
The handler function takes the following arguments:
|
881
|
+
|
882
|
+
<ul>
|
883
|
+
<li> <code>message</code> - The message received from the warn call. </li>
|
884
|
+
<li> <code>options</code> - An object passed in with the warn call containing additional information including:</li>
|
885
|
+
<ul>
|
886
|
+
<li> <code>id</code> - An id of the warning in the form of <code>package-name.specific-warning</code>.</li>
|
887
|
+
</ul>
|
888
|
+
<li> <code>next</code> - A function that calls into the previously registered handler.</li>
|
889
|
+
</ul>
|
890
|
+
|
891
|
+
@public
|
892
|
+
@static
|
893
|
+
@method registerWarnHandler
|
894
|
+
@param handler {Function} A function to handle warnings.
|
895
|
+
@since 2.1.0
|
896
|
+
*/
|
897
|
+
function registerHandler(handler) {
|
898
|
+
(0, _handlers.registerHandler)('warn', handler);
|
124
899
|
}
|
125
900
|
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
writable: true,
|
131
|
-
configurable: true
|
901
|
+
registerHandler(function logWarning(message, options) {
|
902
|
+
_emberConsole.default.warn('WARNING: ' + message);
|
903
|
+
if ('trace' in _emberConsole.default) {
|
904
|
+
_emberConsole.default.trace();
|
132
905
|
}
|
133
906
|
});
|
134
907
|
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
}
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
}
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
slice: Array.prototype.slice,
|
182
|
-
createClass: createClass,
|
183
|
-
interopExportWildcard: interopExportWildcard,
|
184
|
-
defaults: defaults
|
185
|
-
};
|
908
|
+
var missingOptionsDeprecation = exports.missingOptionsDeprecation = 'When calling `Ember.warn` you ' + 'must provide an `options` hash as the third parameter. ' + '`options` should include an `id` property.';
|
909
|
+
var missingOptionsIdDeprecation = exports.missingOptionsIdDeprecation = 'When calling `Ember.warn` you must provide `id` in options.';
|
910
|
+
|
911
|
+
/**
|
912
|
+
@module ember
|
913
|
+
@submodule ember-debug
|
914
|
+
*/
|
915
|
+
|
916
|
+
/**
|
917
|
+
Display a warning with the provided message.
|
918
|
+
|
919
|
+
* In a production build, this method is defined as an empty function (NOP).
|
920
|
+
Uses of this method in Ember itself are stripped from the ember.prod.js build.
|
921
|
+
|
922
|
+
@method warn
|
923
|
+
@param {String} message A warning to display.
|
924
|
+
@param {Boolean} test An optional boolean. If falsy, the warning
|
925
|
+
will be displayed.
|
926
|
+
@param {Object} options An object that can be used to pass a unique
|
927
|
+
`id` for this warning. The `id` can be used by Ember debugging tools
|
928
|
+
to change the behavior (raise, log, or silence) for that specific warning.
|
929
|
+
The `id` should be namespaced by dots, e.g. "ember-debug.feature-flag-with-features-stripped"
|
930
|
+
@for Ember
|
931
|
+
@public
|
932
|
+
@since 1.0.0
|
933
|
+
*/
|
934
|
+
function warn(message, test, options) {
|
935
|
+
if (arguments.length === 2 && typeof test === 'object') {
|
936
|
+
options = test;
|
937
|
+
test = false;
|
938
|
+
}
|
939
|
+
if (!options) {
|
940
|
+
(0, _deprecate.default)(missingOptionsDeprecation, false, {
|
941
|
+
id: 'ember-debug.warn-options-missing',
|
942
|
+
until: '3.0.0',
|
943
|
+
url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options'
|
944
|
+
});
|
945
|
+
}
|
946
|
+
|
947
|
+
if (options && !options.id) {
|
948
|
+
(0, _deprecate.default)(missingOptionsIdDeprecation, false, {
|
949
|
+
id: 'ember-debug.warn-id-missing',
|
950
|
+
until: '3.0.0',
|
951
|
+
url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options'
|
952
|
+
});
|
953
|
+
}
|
186
954
|
|
955
|
+
(0, _handlers.invoke)('warn', message, test, options);
|
956
|
+
}
|
957
|
+
});
|
187
958
|
enifed('ember-testing/adapters/adapter', ['exports', 'ember-runtime'], function (exports, _emberRuntime) {
|
188
959
|
'use strict';
|
189
960
|
|
@@ -240,19 +1011,10 @@ enifed('ember-testing/adapters/adapter', ['exports', 'ember-runtime'], function
|
|
240
1011
|
}
|
241
1012
|
});
|
242
1013
|
});
|
243
|
-
enifed('ember-testing/adapters/qunit', ['exports', 'ember-utils', 'ember-testing/adapters/adapter'], function (exports, _emberUtils,
|
1014
|
+
enifed('ember-testing/adapters/qunit', ['exports', 'ember-utils', 'ember-testing/adapters/adapter'], function (exports, _emberUtils, _adapter) {
|
244
1015
|
'use strict';
|
245
1016
|
|
246
|
-
|
247
|
-
This class implements the methods defined by Ember.Test.Adapter for the
|
248
|
-
QUnit testing framework.
|
249
|
-
|
250
|
-
@class QUnitAdapter
|
251
|
-
@namespace Ember.Test
|
252
|
-
@extends Ember.Test.Adapter
|
253
|
-
@public
|
254
|
-
*/
|
255
|
-
exports.default = _emberTestingAdaptersAdapter.default.extend({
|
1017
|
+
exports.default = _adapter.default.extend({
|
256
1018
|
asyncStart: function () {
|
257
1019
|
QUnit.stop();
|
258
1020
|
},
|
@@ -260,7 +1022,7 @@ enifed('ember-testing/adapters/qunit', ['exports', 'ember-utils', 'ember-testing
|
|
260
1022
|
QUnit.start();
|
261
1023
|
},
|
262
1024
|
exception: function (error) {
|
263
|
-
ok(false, _emberUtils.inspect(error));
|
1025
|
+
ok(false, (0, _emberUtils.inspect)(error));
|
264
1026
|
}
|
265
1027
|
});
|
266
1028
|
});
|
@@ -270,6 +1032,7 @@ enifed('ember-testing/events', ['exports', 'ember-views', 'ember-metal'], functi
|
|
270
1032
|
exports.focus = focus;
|
271
1033
|
exports.fireEvent = fireEvent;
|
272
1034
|
|
1035
|
+
|
273
1036
|
var DEFAULT_EVENT_OPTIONS = { canBubble: true, cancelable: true };
|
274
1037
|
var KEYBOARD_EVENT_TYPES = ['keydown', 'keypress', 'keyup'];
|
275
1038
|
var MOUSE_EVENT_TYPES = ['click', 'mousedown', 'mouseup', 'dblclick', 'mouseenter', 'mouseleave', 'mousemove', 'mouseout', 'mouseover'];
|
@@ -278,11 +1041,11 @@ enifed('ember-testing/events', ['exports', 'ember-views', 'ember-metal'], functi
|
|
278
1041
|
if (!el) {
|
279
1042
|
return;
|
280
1043
|
}
|
281
|
-
var $el = _emberViews.jQuery(el);
|
1044
|
+
var $el = (0, _emberViews.jQuery)(el);
|
282
1045
|
if ($el.is(':input, [contenteditable=true]')) {
|
283
1046
|
var type = $el.prop('type');
|
284
1047
|
if (type !== 'checkbox' && type !== 'radio' && type !== 'hidden') {
|
285
|
-
_emberMetal.run(null, function () {
|
1048
|
+
(0, _emberMetal.run)(null, function () {
|
286
1049
|
// Firefox does not trigger the `focusin` event if the window
|
287
1050
|
// does not have focus. If the document doesn't have focus just
|
288
1051
|
// use trigger('focusin') instead.
|
@@ -298,12 +1061,12 @@ enifed('ember-testing/events', ['exports', 'ember-views', 'ember-metal'], functi
|
|
298
1061
|
}
|
299
1062
|
|
300
1063
|
function fireEvent(element, type) {
|
301
|
-
var options = arguments.length
|
1064
|
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
302
1065
|
|
303
1066
|
if (!element) {
|
304
1067
|
return;
|
305
1068
|
}
|
306
|
-
var event =
|
1069
|
+
var event = void 0;
|
307
1070
|
if (KEYBOARD_EVENT_TYPES.indexOf(type) > -1) {
|
308
1071
|
event = buildKeyboardEvent(type, options);
|
309
1072
|
} else if (MOUSE_EVENT_TYPES.indexOf(type) > -1) {
|
@@ -324,7 +1087,7 @@ enifed('ember-testing/events', ['exports', 'ember-views', 'ember-metal'], functi
|
|
324
1087
|
}
|
325
1088
|
|
326
1089
|
function buildBasicEvent(type) {
|
327
|
-
var options = arguments.length
|
1090
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
328
1091
|
|
329
1092
|
var event = document.createEvent('Events');
|
330
1093
|
event.initEvent(type, true, true);
|
@@ -333,9 +1096,9 @@ enifed('ember-testing/events', ['exports', 'ember-views', 'ember-metal'], functi
|
|
333
1096
|
}
|
334
1097
|
|
335
1098
|
function buildMouseEvent(type) {
|
336
|
-
var options = arguments.length
|
1099
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
337
1100
|
|
338
|
-
var event =
|
1101
|
+
var event = void 0;
|
339
1102
|
try {
|
340
1103
|
event = document.createEvent('MouseEvents');
|
341
1104
|
var eventOpts = _emberViews.jQuery.extend({}, DEFAULT_EVENT_OPTIONS, options);
|
@@ -347,9 +1110,9 @@ enifed('ember-testing/events', ['exports', 'ember-views', 'ember-metal'], functi
|
|
347
1110
|
}
|
348
1111
|
|
349
1112
|
function buildKeyboardEvent(type) {
|
350
|
-
var options = arguments.length
|
1113
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
351
1114
|
|
352
|
-
var event =
|
1115
|
+
var event = void 0;
|
353
1116
|
try {
|
354
1117
|
event = document.createEvent('KeyEvents');
|
355
1118
|
var eventOpts = _emberViews.jQuery.extend({}, DEFAULT_EVENT_OPTIONS, options);
|
@@ -360,7 +1123,7 @@ enifed('ember-testing/events', ['exports', 'ember-views', 'ember-metal'], functi
|
|
360
1123
|
return event;
|
361
1124
|
}
|
362
1125
|
});
|
363
|
-
enifed('ember-testing/ext/application', ['
|
1126
|
+
enifed('ember-testing/ext/application', ['ember-application', 'ember-testing/setup_for_testing', 'ember-testing/test/helpers', 'ember-testing/test/promise', 'ember-testing/test/run', 'ember-testing/test/on_inject_helpers', 'ember-testing/test/adapter'], function (_emberApplication, _setup_for_testing, _helpers, _promise, _run, _on_inject_helpers, _adapter) {
|
364
1127
|
'use strict';
|
365
1128
|
|
366
1129
|
_emberApplication.Application.reopen({
|
@@ -401,21 +1164,8 @@ enifed('ember-testing/ext/application', ['exports', 'ember-application', 'ember-
|
|
401
1164
|
*/
|
402
1165
|
testing: false,
|
403
1166
|
|
404
|
-
/**
|
405
|
-
This hook defers the readiness of the application, so that you can start
|
406
|
-
the app when your tests are ready to run. It also sets the router's
|
407
|
-
location to 'none', so that the window's location will not be modified
|
408
|
-
(preventing both accidental leaking of state between tests and interference
|
409
|
-
with your testing framework).
|
410
|
-
Example:
|
411
|
-
```
|
412
|
-
App.setupForTesting();
|
413
|
-
```
|
414
|
-
@method setupForTesting
|
415
|
-
@public
|
416
|
-
*/
|
417
1167
|
setupForTesting: function () {
|
418
|
-
|
1168
|
+
(0, _setup_for_testing.default)();
|
419
1169
|
|
420
1170
|
this.testing = true;
|
421
1171
|
|
@@ -424,6 +1174,7 @@ enifed('ember-testing/ext/application', ['exports', 'ember-application', 'ember-
|
|
424
1174
|
});
|
425
1175
|
},
|
426
1176
|
|
1177
|
+
|
427
1178
|
/**
|
428
1179
|
This will be used as the container to inject the test helpers into. By
|
429
1180
|
default the helpers are injected into `window`.
|
@@ -435,21 +1186,6 @@ enifed('ember-testing/ext/application', ['exports', 'ember-application', 'ember-
|
|
435
1186
|
*/
|
436
1187
|
helperContainer: null,
|
437
1188
|
|
438
|
-
/**
|
439
|
-
This injects the test helpers into the `helperContainer` object. If an object is provided
|
440
|
-
it will be used as the helperContainer. If `helperContainer` is not set it will default
|
441
|
-
to `window`. If a function of the same name has already been defined it will be cached
|
442
|
-
(so that it can be reset if the helper is removed with `unregisterHelper` or
|
443
|
-
`removeTestHelpers`).
|
444
|
-
Any callbacks registered with `onInjectHelpers` will be called once the
|
445
|
-
helpers have been injected.
|
446
|
-
Example:
|
447
|
-
```
|
448
|
-
App.injectTestHelpers();
|
449
|
-
```
|
450
|
-
@method injectTestHelpers
|
451
|
-
@public
|
452
|
-
*/
|
453
1189
|
injectTestHelpers: function (helperContainer) {
|
454
1190
|
if (helperContainer) {
|
455
1191
|
this.helperContainer = helperContainer;
|
@@ -465,35 +1201,24 @@ enifed('ember-testing/ext/application', ['exports', 'ember-application', 'ember-
|
|
465
1201
|
});
|
466
1202
|
|
467
1203
|
this.testHelpers = {};
|
468
|
-
for (var
|
469
|
-
this.originalMethods[
|
470
|
-
this.testHelpers[
|
471
|
-
protoWrap(
|
1204
|
+
for (var name in _helpers.helpers) {
|
1205
|
+
this.originalMethods[name] = this.helperContainer[name];
|
1206
|
+
this.testHelpers[name] = this.helperContainer[name] = helper(this, name);
|
1207
|
+
protoWrap(_promise.default.prototype, name, helper(this, name), _helpers.helpers[name].meta.wait);
|
472
1208
|
}
|
473
1209
|
|
474
|
-
|
1210
|
+
(0, _on_inject_helpers.invokeInjectHelpersCallbacks)(this);
|
475
1211
|
},
|
476
|
-
|
477
|
-
/**
|
478
|
-
This removes all helpers that have been registered, and resets and functions
|
479
|
-
that were overridden by the helpers.
|
480
|
-
Example:
|
481
|
-
```javascript
|
482
|
-
App.removeTestHelpers();
|
483
|
-
```
|
484
|
-
@public
|
485
|
-
@method removeTestHelpers
|
486
|
-
*/
|
487
1212
|
removeTestHelpers: function () {
|
488
1213
|
if (!this.helperContainer) {
|
489
1214
|
return;
|
490
1215
|
}
|
491
1216
|
|
492
|
-
for (var
|
493
|
-
this.helperContainer[
|
494
|
-
delete
|
495
|
-
delete this.testHelpers[
|
496
|
-
delete this.originalMethods[
|
1217
|
+
for (var name in _helpers.helpers) {
|
1218
|
+
this.helperContainer[name] = this.originalMethods[name];
|
1219
|
+
delete _promise.default.prototype[name];
|
1220
|
+
delete this.testHelpers[name];
|
1221
|
+
delete this.originalMethods[name];
|
497
1222
|
}
|
498
1223
|
}
|
499
1224
|
});
|
@@ -518,8 +1243,8 @@ enifed('ember-testing/ext/application', ['exports', 'ember-application', 'ember-
|
|
518
1243
|
}
|
519
1244
|
|
520
1245
|
function helper(app, name) {
|
521
|
-
var fn =
|
522
|
-
var meta =
|
1246
|
+
var fn = _helpers.helpers[name].method;
|
1247
|
+
var meta = _helpers.helpers[name].meta;
|
523
1248
|
if (!meta.wait) {
|
524
1249
|
return function () {
|
525
1250
|
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
@@ -535,30 +1260,30 @@ enifed('ember-testing/ext/application', ['exports', 'ember-application', 'ember-
|
|
535
1260
|
args[_key3] = arguments[_key3];
|
536
1261
|
}
|
537
1262
|
|
538
|
-
var lastPromise =
|
539
|
-
return
|
1263
|
+
var lastPromise = (0, _run.default)(function () {
|
1264
|
+
return (0, _promise.resolve)((0, _promise.getLastPromise)());
|
540
1265
|
});
|
541
1266
|
|
542
1267
|
// wait for last helper's promise to resolve and then
|
543
1268
|
// execute. To be safe, we need to tell the adapter we're going
|
544
1269
|
// asynchronous here, because fn may not be invoked before we
|
545
1270
|
// return.
|
546
|
-
|
1271
|
+
(0, _adapter.asyncStart)();
|
547
1272
|
return lastPromise.then(function () {
|
548
1273
|
return fn.apply(app, [app].concat(args));
|
549
|
-
}).finally(
|
1274
|
+
}).finally(_adapter.asyncEnd);
|
550
1275
|
};
|
551
1276
|
}
|
552
1277
|
});
|
553
|
-
enifed('ember-testing/ext/rsvp', ['exports', 'ember-runtime', 'ember-metal', 'ember-debug', 'ember-testing/test/adapter'], function (exports, _emberRuntime, _emberMetal, _emberDebug,
|
1278
|
+
enifed('ember-testing/ext/rsvp', ['exports', 'ember-runtime', 'ember-metal', 'ember-debug', 'ember-testing/test/adapter'], function (exports, _emberRuntime, _emberMetal, _emberDebug, _adapter) {
|
554
1279
|
'use strict';
|
555
1280
|
|
556
1281
|
_emberRuntime.RSVP.configure('async', function (callback, promise) {
|
557
1282
|
// if schedule will cause autorun, we need to inform adapter
|
558
|
-
if (_emberDebug.isTesting() && !_emberMetal.run.backburner.currentInstance) {
|
559
|
-
|
1283
|
+
if ((0, _emberDebug.isTesting)() && !_emberMetal.run.backburner.currentInstance) {
|
1284
|
+
(0, _adapter.asyncStart)();
|
560
1285
|
_emberMetal.run.backburner.schedule('actions', function () {
|
561
|
-
|
1286
|
+
(0, _adapter.asyncEnd)();
|
562
1287
|
callback(promise);
|
563
1288
|
});
|
564
1289
|
} else {
|
@@ -570,50 +1295,43 @@ enifed('ember-testing/ext/rsvp', ['exports', 'ember-runtime', 'ember-metal', 'em
|
|
570
1295
|
|
571
1296
|
exports.default = _emberRuntime.RSVP;
|
572
1297
|
});
|
573
|
-
enifed('ember-testing/helpers', ['
|
1298
|
+
enifed('ember-testing/helpers', ['ember-testing/test/helpers', 'ember-testing/helpers/and_then', 'ember-testing/helpers/click', 'ember-testing/helpers/current_path', 'ember-testing/helpers/current_route_name', 'ember-testing/helpers/current_url', 'ember-testing/helpers/fill_in', 'ember-testing/helpers/find', 'ember-testing/helpers/find_with_assert', 'ember-testing/helpers/key_event', 'ember-testing/helpers/pause_test', 'ember-testing/helpers/trigger_event', 'ember-testing/helpers/visit', 'ember-testing/helpers/wait'], function (_helpers, _and_then, _click, _current_path, _current_route_name, _current_url, _fill_in, _find, _find_with_assert, _key_event, _pause_test, _trigger_event, _visit, _wait) {
|
574
1299
|
'use strict';
|
575
1300
|
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
if (true) {
|
592
|
-
_emberTestingTestHelpers.registerHelper('resumeTest', _emberTestingHelpersPause_test.resumeTest);
|
593
|
-
}
|
1301
|
+
(0, _helpers.registerAsyncHelper)('visit', _visit.default);
|
1302
|
+
(0, _helpers.registerAsyncHelper)('click', _click.default);
|
1303
|
+
(0, _helpers.registerAsyncHelper)('keyEvent', _key_event.default);
|
1304
|
+
(0, _helpers.registerAsyncHelper)('fillIn', _fill_in.default);
|
1305
|
+
(0, _helpers.registerAsyncHelper)('wait', _wait.default);
|
1306
|
+
(0, _helpers.registerAsyncHelper)('andThen', _and_then.default);
|
1307
|
+
(0, _helpers.registerAsyncHelper)('pauseTest', _pause_test.pauseTest);
|
1308
|
+
(0, _helpers.registerAsyncHelper)('triggerEvent', _trigger_event.default);
|
1309
|
+
|
1310
|
+
(0, _helpers.registerHelper)('find', _find.default);
|
1311
|
+
(0, _helpers.registerHelper)('findWithAssert', _find_with_assert.default);
|
1312
|
+
(0, _helpers.registerHelper)('currentRouteName', _current_route_name.default);
|
1313
|
+
(0, _helpers.registerHelper)('currentPath', _current_path.default);
|
1314
|
+
(0, _helpers.registerHelper)('currentURL', _current_url.default);
|
1315
|
+
(0, _helpers.registerHelper)('resumeTest', _pause_test.resumeTest);
|
594
1316
|
});
|
595
1317
|
enifed("ember-testing/helpers/and_then", ["exports"], function (exports) {
|
1318
|
+
"use strict";
|
1319
|
+
|
1320
|
+
exports.default = andThen;
|
596
1321
|
/**
|
597
1322
|
@module ember
|
598
1323
|
@submodule ember-testing
|
599
1324
|
*/
|
600
|
-
"use strict";
|
601
|
-
|
602
|
-
exports.default = andThen;
|
603
|
-
|
604
1325
|
function andThen(app, callback) {
|
605
1326
|
return app.testHelpers.wait(callback(app));
|
606
1327
|
}
|
607
1328
|
});
|
608
|
-
enifed('ember-testing/helpers/click', ['exports', 'ember-testing/events'], function (exports,
|
609
|
-
/**
|
610
|
-
@module ember
|
611
|
-
@submodule ember-testing
|
612
|
-
*/
|
1329
|
+
enifed('ember-testing/helpers/click', ['exports', 'ember-testing/events'], function (exports, _events) {
|
613
1330
|
'use strict';
|
614
1331
|
|
615
1332
|
exports.default = click;
|
616
1333
|
|
1334
|
+
|
617
1335
|
/**
|
618
1336
|
Clicks an element and triggers any actions triggered by the element's `click`
|
619
1337
|
event.
|
@@ -632,30 +1350,29 @@ enifed('ember-testing/helpers/click', ['exports', 'ember-testing/events'], funct
|
|
632
1350
|
@return {RSVP.Promise}
|
633
1351
|
@public
|
634
1352
|
*/
|
635
|
-
|
636
1353
|
function click(app, selector, context) {
|
637
1354
|
var $el = app.testHelpers.findWithAssert(selector, context);
|
638
1355
|
var el = $el[0];
|
639
1356
|
|
640
|
-
|
1357
|
+
(0, _events.fireEvent)(el, 'mousedown');
|
641
1358
|
|
642
|
-
|
1359
|
+
(0, _events.focus)(el);
|
643
1360
|
|
644
|
-
|
645
|
-
|
1361
|
+
(0, _events.fireEvent)(el, 'mouseup');
|
1362
|
+
(0, _events.fireEvent)(el, 'click');
|
646
1363
|
|
647
1364
|
return app.testHelpers.wait();
|
648
|
-
}
|
1365
|
+
} /**
|
1366
|
+
@module ember
|
1367
|
+
@submodule ember-testing
|
1368
|
+
*/
|
649
1369
|
});
|
650
1370
|
enifed('ember-testing/helpers/current_path', ['exports', 'ember-metal'], function (exports, _emberMetal) {
|
651
|
-
/**
|
652
|
-
@module ember
|
653
|
-
@submodule ember-testing
|
654
|
-
*/
|
655
1371
|
'use strict';
|
656
1372
|
|
657
1373
|
exports.default = currentPath;
|
658
1374
|
|
1375
|
+
|
659
1376
|
/**
|
660
1377
|
Returns the current path.
|
661
1378
|
|
@@ -674,17 +1391,15 @@ enifed('ember-testing/helpers/current_path', ['exports', 'ember-metal'], functio
|
|
674
1391
|
@since 1.5.0
|
675
1392
|
@public
|
676
1393
|
*/
|
677
|
-
|
678
1394
|
function currentPath(app) {
|
679
1395
|
var routingService = app.__container__.lookup('service:-routing');
|
680
|
-
return _emberMetal.get(routingService, 'currentPath');
|
681
|
-
}
|
1396
|
+
return (0, _emberMetal.get)(routingService, 'currentPath');
|
1397
|
+
} /**
|
1398
|
+
@module ember
|
1399
|
+
@submodule ember-testing
|
1400
|
+
*/
|
682
1401
|
});
|
683
1402
|
enifed('ember-testing/helpers/current_route_name', ['exports', 'ember-metal'], function (exports, _emberMetal) {
|
684
|
-
/**
|
685
|
-
@module ember
|
686
|
-
@submodule ember-testing
|
687
|
-
*/
|
688
1403
|
'use strict';
|
689
1404
|
|
690
1405
|
exports.default = currentRouteName;
|
@@ -703,21 +1418,20 @@ enifed('ember-testing/helpers/current_route_name', ['exports', 'ember-metal'], f
|
|
703
1418
|
@since 1.5.0
|
704
1419
|
@public
|
705
1420
|
*/
|
706
|
-
|
707
1421
|
function currentRouteName(app) {
|
708
1422
|
var routingService = app.__container__.lookup('service:-routing');
|
709
|
-
return _emberMetal.get(routingService, 'currentRouteName');
|
710
|
-
}
|
1423
|
+
return (0, _emberMetal.get)(routingService, 'currentRouteName');
|
1424
|
+
} /**
|
1425
|
+
@module ember
|
1426
|
+
@submodule ember-testing
|
1427
|
+
*/
|
711
1428
|
});
|
712
1429
|
enifed('ember-testing/helpers/current_url', ['exports', 'ember-metal'], function (exports, _emberMetal) {
|
713
|
-
/**
|
714
|
-
@module ember
|
715
|
-
@submodule ember-testing
|
716
|
-
*/
|
717
1430
|
'use strict';
|
718
1431
|
|
719
1432
|
exports.default = currentURL;
|
720
1433
|
|
1434
|
+
|
721
1435
|
/**
|
722
1436
|
Returns the current URL.
|
723
1437
|
|
@@ -736,21 +1450,20 @@ enifed('ember-testing/helpers/current_url', ['exports', 'ember-metal'], function
|
|
736
1450
|
@since 1.5.0
|
737
1451
|
@public
|
738
1452
|
*/
|
739
|
-
|
740
1453
|
function currentURL(app) {
|
741
1454
|
var router = app.__container__.lookup('router:main');
|
742
|
-
return _emberMetal.get(router, 'location').getURL();
|
743
|
-
}
|
1455
|
+
return (0, _emberMetal.get)(router, 'location').getURL();
|
1456
|
+
} /**
|
1457
|
+
@module ember
|
1458
|
+
@submodule ember-testing
|
1459
|
+
*/
|
744
1460
|
});
|
745
|
-
enifed('ember-testing/helpers/fill_in', ['exports', 'ember-testing/events'], function (exports,
|
746
|
-
/**
|
747
|
-
@module ember
|
748
|
-
@submodule ember-testing
|
749
|
-
*/
|
1461
|
+
enifed('ember-testing/helpers/fill_in', ['exports', 'ember-testing/events'], function (exports, _events) {
|
750
1462
|
'use strict';
|
751
1463
|
|
752
1464
|
exports.default = fillIn;
|
753
1465
|
|
1466
|
+
|
754
1467
|
/**
|
755
1468
|
Fills in an input element with some text.
|
756
1469
|
|
@@ -769,11 +1482,10 @@ enifed('ember-testing/helpers/fill_in', ['exports', 'ember-testing/events'], fun
|
|
769
1482
|
@return {RSVP.Promise}
|
770
1483
|
@public
|
771
1484
|
*/
|
772
|
-
|
773
1485
|
function fillIn(app, selector, contextOrText, text) {
|
774
|
-
var $el =
|
775
|
-
el =
|
776
|
-
context =
|
1486
|
+
var $el = void 0,
|
1487
|
+
el = void 0,
|
1488
|
+
context = void 0;
|
777
1489
|
if (typeof text === 'undefined') {
|
778
1490
|
text = contextOrText;
|
779
1491
|
} else {
|
@@ -781,24 +1493,24 @@ enifed('ember-testing/helpers/fill_in', ['exports', 'ember-testing/events'], fun
|
|
781
1493
|
}
|
782
1494
|
$el = app.testHelpers.findWithAssert(selector, context);
|
783
1495
|
el = $el[0];
|
784
|
-
|
1496
|
+
(0, _events.focus)(el);
|
785
1497
|
|
786
1498
|
$el.eq(0).val(text);
|
787
|
-
|
788
|
-
|
1499
|
+
(0, _events.fireEvent)(el, 'input');
|
1500
|
+
(0, _events.fireEvent)(el, 'change');
|
789
1501
|
|
790
1502
|
return app.testHelpers.wait();
|
791
|
-
}
|
1503
|
+
} /**
|
1504
|
+
@module ember
|
1505
|
+
@submodule ember-testing
|
1506
|
+
*/
|
792
1507
|
});
|
793
1508
|
enifed('ember-testing/helpers/find', ['exports', 'ember-metal'], function (exports, _emberMetal) {
|
794
|
-
/**
|
795
|
-
@module ember
|
796
|
-
@submodule ember-testing
|
797
|
-
*/
|
798
1509
|
'use strict';
|
799
1510
|
|
800
1511
|
exports.default = find;
|
801
1512
|
|
1513
|
+
|
802
1514
|
/**
|
803
1515
|
Finds an element in the context of the app's container element. A simple alias
|
804
1516
|
for `app.$(selector)`.
|
@@ -822,15 +1534,20 @@ enifed('ember-testing/helpers/find', ['exports', 'ember-metal'], function (expor
|
|
822
1534
|
@return {Object} jQuery object representing the results of the query
|
823
1535
|
@public
|
824
1536
|
*/
|
825
|
-
|
826
1537
|
function find(app, selector, context) {
|
827
|
-
var $el =
|
828
|
-
context = context || _emberMetal.get(app, 'rootElement');
|
1538
|
+
var $el = void 0;
|
1539
|
+
context = context || (0, _emberMetal.get)(app, 'rootElement');
|
829
1540
|
$el = app.$(selector, context);
|
830
1541
|
return $el;
|
831
|
-
}
|
1542
|
+
} /**
|
1543
|
+
@module ember
|
1544
|
+
@submodule ember-testing
|
1545
|
+
*/
|
832
1546
|
});
|
833
1547
|
enifed('ember-testing/helpers/find_with_assert', ['exports'], function (exports) {
|
1548
|
+
'use strict';
|
1549
|
+
|
1550
|
+
exports.default = findWithAssert;
|
834
1551
|
/**
|
835
1552
|
@module ember
|
836
1553
|
@submodule ember-testing
|
@@ -859,10 +1576,6 @@ enifed('ember-testing/helpers/find_with_assert', ['exports'], function (exports)
|
|
859
1576
|
@throws {Error} throws error if jQuery object returned has a length of 0
|
860
1577
|
@public
|
861
1578
|
*/
|
862
|
-
'use strict';
|
863
|
-
|
864
|
-
exports.default = findWithAssert;
|
865
|
-
|
866
1579
|
function findWithAssert(app, selector, context) {
|
867
1580
|
var $el = app.testHelpers.find(selector, context);
|
868
1581
|
if ($el.length === 0) {
|
@@ -872,6 +1585,9 @@ enifed('ember-testing/helpers/find_with_assert', ['exports'], function (exports)
|
|
872
1585
|
}
|
873
1586
|
});
|
874
1587
|
enifed('ember-testing/helpers/key_event', ['exports'], function (exports) {
|
1588
|
+
'use strict';
|
1589
|
+
|
1590
|
+
exports.default = keyEvent;
|
875
1591
|
/**
|
876
1592
|
@module ember
|
877
1593
|
@submodule ember-testing
|
@@ -892,13 +1608,9 @@ enifed('ember-testing/helpers/key_event', ['exports'], function (exports) {
|
|
892
1608
|
@since 1.5.0
|
893
1609
|
@public
|
894
1610
|
*/
|
895
|
-
'use strict';
|
896
|
-
|
897
|
-
exports.default = keyEvent;
|
898
|
-
|
899
1611
|
function keyEvent(app, selector, contextOrType, typeOrKeyCode, keyCode) {
|
900
|
-
var context =
|
901
|
-
type =
|
1612
|
+
var context = void 0,
|
1613
|
+
type = void 0;
|
902
1614
|
|
903
1615
|
if (typeof keyCode === 'undefined') {
|
904
1616
|
context = null;
|
@@ -913,16 +1625,13 @@ enifed('ember-testing/helpers/key_event', ['exports'], function (exports) {
|
|
913
1625
|
}
|
914
1626
|
});
|
915
1627
|
enifed('ember-testing/helpers/pause_test', ['exports', 'ember-runtime', 'ember-console', 'ember-debug'], function (exports, _emberRuntime, _emberConsole, _emberDebug) {
|
916
|
-
/**
|
917
|
-
@module ember
|
918
|
-
@submodule ember-testing
|
919
|
-
*/
|
920
1628
|
'use strict';
|
921
1629
|
|
922
1630
|
exports.resumeTest = resumeTest;
|
923
1631
|
exports.pauseTest = pauseTest;
|
924
1632
|
|
925
|
-
|
1633
|
+
|
1634
|
+
var resume = void 0;
|
926
1635
|
|
927
1636
|
/**
|
928
1637
|
Resumes a test paused by `pauseTest`.
|
@@ -931,9 +1640,13 @@ enifed('ember-testing/helpers/pause_test', ['exports', 'ember-runtime', 'ember-c
|
|
931
1640
|
@return {void}
|
932
1641
|
@public
|
933
1642
|
*/
|
934
|
-
|
1643
|
+
/**
|
1644
|
+
@module ember
|
1645
|
+
@submodule ember-testing
|
1646
|
+
*/
|
935
1647
|
function resumeTest() {
|
936
|
-
_emberDebug.assert('Testing has not been paused. There is nothing to resume.', resume);
|
1648
|
+
(true && (0, _emberDebug.assert)('Testing has not been paused. There is nothing to resume.', resume));
|
1649
|
+
|
937
1650
|
resume();
|
938
1651
|
resume = undefined;
|
939
1652
|
}
|
@@ -953,24 +1666,15 @@ enifed('ember-testing/helpers/pause_test', ['exports', 'ember-runtime', 'ember-c
|
|
953
1666
|
@return {Object} A promise that will never resolve
|
954
1667
|
@public
|
955
1668
|
*/
|
956
|
-
|
957
1669
|
function pauseTest() {
|
958
|
-
|
959
|
-
_emberConsole.default.info('Testing paused. Use `resumeTest()` to continue.');
|
960
|
-
}
|
1670
|
+
_emberConsole.default.info('Testing paused. Use `resumeTest()` to continue.');
|
961
1671
|
|
962
1672
|
return new _emberRuntime.RSVP.Promise(function (resolve) {
|
963
|
-
|
964
|
-
resume = resolve;
|
965
|
-
}
|
1673
|
+
resume = resolve;
|
966
1674
|
}, 'TestAdapter paused promise');
|
967
1675
|
}
|
968
1676
|
});
|
969
|
-
enifed('ember-testing/helpers/trigger_event', ['exports', 'ember-testing/events'], function (exports,
|
970
|
-
/**
|
971
|
-
@module ember
|
972
|
-
@submodule ember-testing
|
973
|
-
*/
|
1677
|
+
enifed('ember-testing/helpers/trigger_event', ['exports', 'ember-testing/events'], function (exports, _events) {
|
974
1678
|
'use strict';
|
975
1679
|
|
976
1680
|
exports.default = triggerEvent;
|
@@ -995,12 +1699,11 @@ enifed('ember-testing/helpers/trigger_event', ['exports', 'ember-testing/events'
|
|
995
1699
|
@since 1.5.0
|
996
1700
|
@public
|
997
1701
|
*/
|
998
|
-
|
999
1702
|
function triggerEvent(app, selector, contextOrType, typeOrOptions, possibleOptions) {
|
1000
1703
|
var arity = arguments.length;
|
1001
|
-
var context =
|
1002
|
-
type =
|
1003
|
-
options =
|
1704
|
+
var context = void 0,
|
1705
|
+
type = void 0,
|
1706
|
+
options = void 0;
|
1004
1707
|
|
1005
1708
|
if (arity === 3) {
|
1006
1709
|
// context and options are optional, so this is
|
@@ -1032,20 +1735,20 @@ enifed('ember-testing/helpers/trigger_event', ['exports', 'ember-testing/events'
|
|
1032
1735
|
var $el = app.testHelpers.findWithAssert(selector, context);
|
1033
1736
|
var el = $el[0];
|
1034
1737
|
|
1035
|
-
|
1738
|
+
(0, _events.fireEvent)(el, type, options);
|
1036
1739
|
|
1037
1740
|
return app.testHelpers.wait();
|
1038
|
-
}
|
1741
|
+
} /**
|
1742
|
+
@module ember
|
1743
|
+
@submodule ember-testing
|
1744
|
+
*/
|
1039
1745
|
});
|
1040
1746
|
enifed('ember-testing/helpers/visit', ['exports', 'ember-metal'], function (exports, _emberMetal) {
|
1041
|
-
/**
|
1042
|
-
@module ember
|
1043
|
-
@submodule ember-testing
|
1044
|
-
*/
|
1045
1747
|
'use strict';
|
1046
1748
|
|
1047
1749
|
exports.default = visit;
|
1048
1750
|
|
1751
|
+
|
1049
1752
|
/**
|
1050
1753
|
Loads a route, sets up any controllers, and renders any templates associated
|
1051
1754
|
with the route as though a real user had triggered the route change while
|
@@ -1064,7 +1767,6 @@ enifed('ember-testing/helpers/visit', ['exports', 'ember-metal'], function (expo
|
|
1064
1767
|
@return {RSVP.Promise}
|
1065
1768
|
@public
|
1066
1769
|
*/
|
1067
|
-
|
1068
1770
|
function visit(app, url) {
|
1069
1771
|
var router = app.__container__.lookup('router:main');
|
1070
1772
|
var shouldHandleURL = false;
|
@@ -1073,30 +1775,30 @@ enifed('ember-testing/helpers/visit', ['exports', 'ember-metal'], function (expo
|
|
1073
1775
|
router.location.setURL(url);
|
1074
1776
|
|
1075
1777
|
if (shouldHandleURL) {
|
1076
|
-
_emberMetal.run(app.__deprecatedInstance__, 'handleURL', url);
|
1778
|
+
(0, _emberMetal.run)(app.__deprecatedInstance__, 'handleURL', url);
|
1077
1779
|
}
|
1078
1780
|
});
|
1079
1781
|
|
1080
1782
|
if (app._readinessDeferrals > 0) {
|
1081
1783
|
router['initialURL'] = url;
|
1082
|
-
_emberMetal.run(app, 'advanceReadiness');
|
1784
|
+
(0, _emberMetal.run)(app, 'advanceReadiness');
|
1083
1785
|
delete router['initialURL'];
|
1084
1786
|
} else {
|
1085
1787
|
shouldHandleURL = true;
|
1086
1788
|
}
|
1087
1789
|
|
1088
1790
|
return app.testHelpers.wait();
|
1089
|
-
}
|
1791
|
+
} /**
|
1792
|
+
@module ember
|
1793
|
+
@submodule ember-testing
|
1794
|
+
*/
|
1090
1795
|
});
|
1091
|
-
enifed('ember-testing/helpers/wait', ['exports', 'ember-testing/test/waiters', 'ember-runtime', 'ember-metal', 'ember-testing/test/pending_requests'], function (exports,
|
1092
|
-
/**
|
1093
|
-
@module ember
|
1094
|
-
@submodule ember-testing
|
1095
|
-
*/
|
1796
|
+
enifed('ember-testing/helpers/wait', ['exports', 'ember-testing/test/waiters', 'ember-runtime', 'ember-metal', 'ember-testing/test/pending_requests'], function (exports, _waiters, _emberRuntime, _emberMetal, _pending_requests) {
|
1096
1797
|
'use strict';
|
1097
1798
|
|
1098
1799
|
exports.default = wait;
|
1099
1800
|
|
1801
|
+
|
1100
1802
|
/**
|
1101
1803
|
Causes the run loop to process any pending events. This is used to ensure that
|
1102
1804
|
any async operations from other helpers (or your assertions) have been processed.
|
@@ -1124,7 +1826,10 @@ enifed('ember-testing/helpers/wait', ['exports', 'ember-testing/test/waiters', '
|
|
1124
1826
|
@public
|
1125
1827
|
@since 1.0.0
|
1126
1828
|
*/
|
1127
|
-
|
1829
|
+
/**
|
1830
|
+
@module ember
|
1831
|
+
@submodule ember-testing
|
1832
|
+
*/
|
1128
1833
|
function wait(app, value) {
|
1129
1834
|
return new _emberRuntime.RSVP.Promise(function (resolve) {
|
1130
1835
|
var router = app.__container__.lookup('router:main');
|
@@ -1138,7 +1843,7 @@ enifed('ember-testing/helpers/wait', ['exports', 'ember-testing/test/waiters', '
|
|
1138
1843
|
}
|
1139
1844
|
|
1140
1845
|
// 2. If there are pending Ajax requests, keep polling
|
1141
|
-
if (
|
1846
|
+
if ((0, _pending_requests.pendingRequests)()) {
|
1142
1847
|
return;
|
1143
1848
|
}
|
1144
1849
|
|
@@ -1147,7 +1852,7 @@ enifed('ember-testing/helpers/wait', ['exports', 'ember-testing/test/waiters', '
|
|
1147
1852
|
return;
|
1148
1853
|
}
|
1149
1854
|
|
1150
|
-
if (
|
1855
|
+
if ((0, _waiters.checkWaiters)()) {
|
1151
1856
|
return;
|
1152
1857
|
}
|
1153
1858
|
|
@@ -1155,34 +1860,46 @@ enifed('ember-testing/helpers/wait', ['exports', 'ember-testing/test/waiters', '
|
|
1155
1860
|
clearInterval(watcher);
|
1156
1861
|
|
1157
1862
|
// Synchronously resolve the promise
|
1158
|
-
_emberMetal.run(null, resolve, value);
|
1863
|
+
(0, _emberMetal.run)(null, resolve, value);
|
1159
1864
|
}, 10);
|
1160
1865
|
});
|
1161
1866
|
}
|
1162
1867
|
});
|
1163
|
-
enifed('ember-testing/index', ['exports', 'ember-testing/
|
1868
|
+
enifed('ember-testing/index', ['exports', 'ember-testing/test', 'ember-testing/adapters/adapter', 'ember-testing/setup_for_testing', 'ember-testing/adapters/qunit', 'ember-testing/support', 'ember-testing/ext/application', 'ember-testing/ext/rsvp', 'ember-testing/helpers', 'ember-testing/initializers'], function (exports, _test, _adapter, _setup_for_testing, _qunit) {
|
1164
1869
|
'use strict';
|
1165
1870
|
|
1166
|
-
exports.Test =
|
1167
|
-
exports
|
1168
|
-
|
1169
|
-
|
1871
|
+
exports.QUnitAdapter = exports.setupForTesting = exports.Adapter = exports.Test = undefined;
|
1872
|
+
Object.defineProperty(exports, 'Test', {
|
1873
|
+
enumerable: true,
|
1874
|
+
get: function () {
|
1875
|
+
return _test.default;
|
1876
|
+
}
|
1877
|
+
});
|
1878
|
+
Object.defineProperty(exports, 'Adapter', {
|
1879
|
+
enumerable: true,
|
1880
|
+
get: function () {
|
1881
|
+
return _adapter.default;
|
1882
|
+
}
|
1883
|
+
});
|
1884
|
+
Object.defineProperty(exports, 'setupForTesting', {
|
1885
|
+
enumerable: true,
|
1886
|
+
get: function () {
|
1887
|
+
return _setup_for_testing.default;
|
1888
|
+
}
|
1889
|
+
});
|
1890
|
+
Object.defineProperty(exports, 'QUnitAdapter', {
|
1891
|
+
enumerable: true,
|
1892
|
+
get: function () {
|
1893
|
+
return _qunit.default;
|
1894
|
+
}
|
1895
|
+
});
|
1170
1896
|
});
|
1171
|
-
|
1172
|
-
// setup RSVP + run loop integration
|
1173
|
-
// adds helpers to helpers object in Test
|
1174
|
-
// to setup initializer
|
1175
|
-
|
1176
|
-
/**
|
1177
|
-
@module ember
|
1178
|
-
@submodule ember-testing
|
1179
|
-
*/
|
1180
|
-
enifed('ember-testing/initializers', ['exports', 'ember-runtime'], function (exports, _emberRuntime) {
|
1897
|
+
enifed('ember-testing/initializers', ['ember-runtime'], function (_emberRuntime) {
|
1181
1898
|
'use strict';
|
1182
1899
|
|
1183
1900
|
var name = 'deferReadiness in `testing` mode';
|
1184
1901
|
|
1185
|
-
_emberRuntime.onLoad('Ember.Application', function (Application) {
|
1902
|
+
(0, _emberRuntime.onLoad)('Ember.Application', function (Application) {
|
1186
1903
|
if (!Application.initializers[name]) {
|
1187
1904
|
Application.initializer({
|
1188
1905
|
name: name,
|
@@ -1196,13 +1913,12 @@ enifed('ember-testing/initializers', ['exports', 'ember-runtime'], function (exp
|
|
1196
1913
|
}
|
1197
1914
|
});
|
1198
1915
|
});
|
1199
|
-
enifed('ember-testing/setup_for_testing', ['exports', 'ember-debug', 'ember-views', 'ember-testing/test/adapter', 'ember-testing/test/pending_requests', 'ember-testing/adapters/adapter', 'ember-testing/adapters/qunit'], function (exports, _emberDebug, _emberViews,
|
1200
|
-
/* global self */
|
1201
|
-
|
1916
|
+
enifed('ember-testing/setup_for_testing', ['exports', 'ember-debug', 'ember-views', 'ember-testing/test/adapter', 'ember-testing/test/pending_requests', 'ember-testing/adapters/adapter', 'ember-testing/adapters/qunit'], function (exports, _emberDebug, _emberViews, _adapter, _pending_requests, _adapter2, _qunit) {
|
1202
1917
|
'use strict';
|
1203
1918
|
|
1204
1919
|
exports.default = setupForTesting;
|
1205
1920
|
|
1921
|
+
|
1206
1922
|
/**
|
1207
1923
|
Sets Ember up for testing. This is useful to perform
|
1208
1924
|
basic setup steps in order to unit test.
|
@@ -1215,28 +1931,29 @@ enifed('ember-testing/setup_for_testing', ['exports', 'ember-debug', 'ember-view
|
|
1215
1931
|
@since 1.5.0
|
1216
1932
|
@private
|
1217
1933
|
*/
|
1934
|
+
/* global self */
|
1218
1935
|
|
1219
1936
|
function setupForTesting() {
|
1220
|
-
_emberDebug.setTesting(true);
|
1937
|
+
(0, _emberDebug.setTesting)(true);
|
1221
1938
|
|
1222
|
-
var adapter =
|
1939
|
+
var adapter = (0, _adapter.getAdapter)();
|
1223
1940
|
// if adapter is not manually set default to QUnit
|
1224
1941
|
if (!adapter) {
|
1225
|
-
|
1942
|
+
(0, _adapter.setAdapter)(typeof self.QUnit === 'undefined' ? new _adapter2.default() : new _qunit.default());
|
1226
1943
|
}
|
1227
1944
|
|
1228
1945
|
if (_emberViews.jQuery) {
|
1229
|
-
_emberViews.jQuery(document).off('ajaxSend',
|
1230
|
-
_emberViews.jQuery(document).off('ajaxComplete',
|
1946
|
+
(0, _emberViews.jQuery)(document).off('ajaxSend', _pending_requests.incrementPendingRequests);
|
1947
|
+
(0, _emberViews.jQuery)(document).off('ajaxComplete', _pending_requests.decrementPendingRequests);
|
1231
1948
|
|
1232
|
-
|
1949
|
+
(0, _pending_requests.clearPendingRequests)();
|
1233
1950
|
|
1234
|
-
_emberViews.jQuery(document).on('ajaxSend',
|
1235
|
-
_emberViews.jQuery(document).on('ajaxComplete',
|
1951
|
+
(0, _emberViews.jQuery)(document).on('ajaxSend', _pending_requests.incrementPendingRequests);
|
1952
|
+
(0, _emberViews.jQuery)(document).on('ajaxComplete', _pending_requests.decrementPendingRequests);
|
1236
1953
|
}
|
1237
1954
|
}
|
1238
1955
|
});
|
1239
|
-
enifed('ember-testing/support', ['
|
1956
|
+
enifed('ember-testing/support', ['ember-debug', 'ember-views', 'ember-environment'], function (_emberDebug, _emberViews, _emberEnvironment) {
|
1240
1957
|
'use strict';
|
1241
1958
|
|
1242
1959
|
/**
|
@@ -1271,7 +1988,6 @@ enifed('ember-testing/support', ['exports', 'ember-debug', 'ember-views', 'ember
|
|
1271
1988
|
testCheckboxClick(function () {
|
1272
1989
|
if (!this.checked && !$.event.special.click) {
|
1273
1990
|
$.event.special.click = {
|
1274
|
-
// For checkbox, fire native event so checked state will be right
|
1275
1991
|
trigger: function () {
|
1276
1992
|
if ($.nodeName(this, 'input') && this.type === 'checkbox' && this.click) {
|
1277
1993
|
this.click();
|
@@ -1284,16 +2000,12 @@ enifed('ember-testing/support', ['exports', 'ember-debug', 'ember-views', 'ember
|
|
1284
2000
|
|
1285
2001
|
// Try again to verify that the patch took effect or blow up.
|
1286
2002
|
testCheckboxClick(function () {
|
1287
|
-
_emberDebug.warn('clicked checkboxes should be checked! the jQuery patch didn\'t work', this.checked, { id: 'ember-testing.test-checkbox-click' });
|
2003
|
+
(true && (0, _emberDebug.warn)('clicked checkboxes should be checked! the jQuery patch didn\'t work', this.checked, { id: 'ember-testing.test-checkbox-click' }));
|
1288
2004
|
});
|
1289
2005
|
});
|
1290
2006
|
}
|
1291
2007
|
});
|
1292
|
-
enifed('ember-testing/test', ['exports', 'ember-testing/test/helpers', 'ember-testing/test/on_inject_helpers', 'ember-testing/test/promise', 'ember-testing/test/waiters', 'ember-testing/test/adapter'], function (exports,
|
1293
|
-
/**
|
1294
|
-
@module ember
|
1295
|
-
@submodule ember-testing
|
1296
|
-
*/
|
2008
|
+
enifed('ember-testing/test', ['exports', 'ember-testing/test/helpers', 'ember-testing/test/on_inject_helpers', 'ember-testing/test/promise', 'ember-testing/test/waiters', 'ember-testing/test/adapter'], function (exports, _helpers, _on_inject_helpers, _promise, _waiters, _adapter) {
|
1297
2009
|
'use strict';
|
1298
2010
|
|
1299
2011
|
/**
|
@@ -1315,18 +2027,18 @@ enifed('ember-testing/test', ['exports', 'ember-testing/test/helpers', 'ember-te
|
|
1315
2027
|
@private
|
1316
2028
|
@since 1.7.0
|
1317
2029
|
*/
|
1318
|
-
_helpers:
|
1319
|
-
|
1320
|
-
registerHelper:
|
1321
|
-
registerAsyncHelper:
|
1322
|
-
unregisterHelper:
|
1323
|
-
onInjectHelpers:
|
1324
|
-
Promise:
|
1325
|
-
promise:
|
1326
|
-
resolve:
|
1327
|
-
registerWaiter:
|
1328
|
-
unregisterWaiter:
|
1329
|
-
checkWaiters:
|
2030
|
+
_helpers: _helpers.helpers,
|
2031
|
+
|
2032
|
+
registerHelper: _helpers.registerHelper,
|
2033
|
+
registerAsyncHelper: _helpers.registerAsyncHelper,
|
2034
|
+
unregisterHelper: _helpers.unregisterHelper,
|
2035
|
+
onInjectHelpers: _on_inject_helpers.onInjectHelpers,
|
2036
|
+
Promise: _promise.default,
|
2037
|
+
promise: _promise.promise,
|
2038
|
+
resolve: _promise.resolve,
|
2039
|
+
registerWaiter: _waiters.registerWaiter,
|
2040
|
+
unregisterWaiter: _waiters.unregisterWaiter,
|
2041
|
+
checkWaiters: _waiters.checkWaiters
|
1330
2042
|
};
|
1331
2043
|
|
1332
2044
|
/**
|
@@ -1349,13 +2061,17 @@ enifed('ember-testing/test', ['exports', 'ember-testing/test/helpers', 'ember-te
|
|
1349
2061
|
@type {Class} The adapter to be used.
|
1350
2062
|
@default Ember.Test.QUnitAdapter
|
1351
2063
|
*/
|
2064
|
+
/**
|
2065
|
+
@module ember
|
2066
|
+
@submodule ember-testing
|
2067
|
+
*/
|
1352
2068
|
Object.defineProperty(Test, 'adapter', {
|
1353
|
-
get:
|
1354
|
-
set:
|
2069
|
+
get: _adapter.getAdapter,
|
2070
|
+
set: _adapter.setAdapter
|
1355
2071
|
});
|
1356
2072
|
|
1357
2073
|
Object.defineProperty(Test, 'waiters', {
|
1358
|
-
get:
|
2074
|
+
get: _waiters.generateDeprecatedWaitersArray
|
1359
2075
|
});
|
1360
2076
|
|
1361
2077
|
exports.default = Test;
|
@@ -1368,8 +2084,8 @@ enifed('ember-testing/test/adapter', ['exports', 'ember-console', 'ember-metal']
|
|
1368
2084
|
exports.asyncStart = asyncStart;
|
1369
2085
|
exports.asyncEnd = asyncEnd;
|
1370
2086
|
|
1371
|
-
var adapter = undefined;
|
1372
2087
|
|
2088
|
+
var adapter = void 0;
|
1373
2089
|
function getAdapter() {
|
1374
2090
|
return adapter;
|
1375
2091
|
}
|
@@ -1377,9 +2093,9 @@ enifed('ember-testing/test/adapter', ['exports', 'ember-console', 'ember-metal']
|
|
1377
2093
|
function setAdapter(value) {
|
1378
2094
|
adapter = value;
|
1379
2095
|
if (value) {
|
1380
|
-
_emberMetal.setDispatchOverride(adapterDispatch);
|
2096
|
+
(0, _emberMetal.setDispatchOverride)(adapterDispatch);
|
1381
2097
|
} else {
|
1382
|
-
_emberMetal.setDispatchOverride(null);
|
2098
|
+
(0, _emberMetal.setDispatchOverride)(null);
|
1383
2099
|
}
|
1384
2100
|
}
|
1385
2101
|
|
@@ -1400,15 +2116,15 @@ enifed('ember-testing/test/adapter', ['exports', 'ember-console', 'ember-metal']
|
|
1400
2116
|
_emberConsole.default.error(error.stack);
|
1401
2117
|
}
|
1402
2118
|
});
|
1403
|
-
enifed('ember-testing/test/helpers', ['exports', 'ember-testing/test/promise'], function (exports,
|
2119
|
+
enifed('ember-testing/test/helpers', ['exports', 'ember-testing/test/promise'], function (exports, _promise) {
|
1404
2120
|
'use strict';
|
1405
2121
|
|
2122
|
+
exports.helpers = undefined;
|
1406
2123
|
exports.registerHelper = registerHelper;
|
1407
2124
|
exports.registerAsyncHelper = registerAsyncHelper;
|
1408
2125
|
exports.unregisterHelper = unregisterHelper;
|
1409
|
-
var helpers = {};
|
2126
|
+
var helpers = exports.helpers = {};
|
1410
2127
|
|
1411
|
-
exports.helpers = helpers;
|
1412
2128
|
/**
|
1413
2129
|
`registerHelper` is used to register a test helper that will be injected
|
1414
2130
|
when `App.injectTestHelpers` is called.
|
@@ -1440,7 +2156,6 @@ enifed('ember-testing/test/helpers', ['exports', 'ember-testing/test/promise'],
|
|
1440
2156
|
@param {Function} helperMethod
|
1441
2157
|
@param options {Object}
|
1442
2158
|
*/
|
1443
|
-
|
1444
2159
|
function registerHelper(name, helperMethod) {
|
1445
2160
|
helpers[name] = {
|
1446
2161
|
method: helperMethod,
|
@@ -1489,7 +2204,6 @@ enifed('ember-testing/test/helpers', ['exports', 'ember-testing/test/promise'],
|
|
1489
2204
|
@param {Function} helperMethod
|
1490
2205
|
@since 1.2.0
|
1491
2206
|
*/
|
1492
|
-
|
1493
2207
|
function registerAsyncHelper(name, helperMethod) {
|
1494
2208
|
helpers[name] = {
|
1495
2209
|
method: helperMethod,
|
@@ -1510,10 +2224,9 @@ enifed('ember-testing/test/helpers', ['exports', 'ember-testing/test/promise'],
|
|
1510
2224
|
@method unregisterHelper
|
1511
2225
|
@param {String} name The helper to remove.
|
1512
2226
|
*/
|
1513
|
-
|
1514
2227
|
function unregisterHelper(name) {
|
1515
2228
|
delete helpers[name];
|
1516
|
-
delete
|
2229
|
+
delete _promise.default.prototype[name];
|
1517
2230
|
}
|
1518
2231
|
});
|
1519
2232
|
enifed("ember-testing/test/on_inject_helpers", ["exports"], function (exports) {
|
@@ -1521,9 +2234,8 @@ enifed("ember-testing/test/on_inject_helpers", ["exports"], function (exports) {
|
|
1521
2234
|
|
1522
2235
|
exports.onInjectHelpers = onInjectHelpers;
|
1523
2236
|
exports.invokeInjectHelpersCallbacks = invokeInjectHelpersCallbacks;
|
1524
|
-
var callbacks = [];
|
2237
|
+
var callbacks = exports.callbacks = [];
|
1525
2238
|
|
1526
|
-
exports.callbacks = callbacks;
|
1527
2239
|
/**
|
1528
2240
|
Used to register callbacks to be fired whenever `App.injectTestHelpers`
|
1529
2241
|
is called.
|
@@ -1549,7 +2261,6 @@ enifed("ember-testing/test/on_inject_helpers", ["exports"], function (exports) {
|
|
1549
2261
|
@method onInjectHelpers
|
1550
2262
|
@param {Function} callback The function to be called.
|
1551
2263
|
*/
|
1552
|
-
|
1553
2264
|
function onInjectHelpers(callback) {
|
1554
2265
|
callbacks.push(callback);
|
1555
2266
|
}
|
@@ -1590,56 +2301,59 @@ enifed("ember-testing/test/pending_requests", ["exports"], function (exports) {
|
|
1590
2301
|
}
|
1591
2302
|
}
|
1592
2303
|
});
|
1593
|
-
enifed('ember-testing/test/promise', ['exports', 'ember-runtime', 'ember-testing/test/run'], function (exports, _emberRuntime,
|
2304
|
+
enifed('ember-testing/test/promise', ['exports', 'ember-babel', 'ember-runtime', 'ember-testing/test/run'], function (exports, _emberBabel, _emberRuntime, _run) {
|
1594
2305
|
'use strict';
|
1595
2306
|
|
1596
2307
|
exports.promise = promise;
|
1597
2308
|
exports.resolve = resolve;
|
1598
2309
|
exports.getLastPromise = getLastPromise;
|
1599
2310
|
|
1600
|
-
var lastPromise = undefined;
|
1601
2311
|
|
1602
|
-
var
|
1603
|
-
|
2312
|
+
var lastPromise = void 0;
|
2313
|
+
|
2314
|
+
var TestPromise = function (_RSVP$Promise) {
|
2315
|
+
(0, _emberBabel.inherits)(TestPromise, _RSVP$Promise);
|
1604
2316
|
|
1605
2317
|
function TestPromise() {
|
1606
|
-
|
2318
|
+
(0, _emberBabel.classCallCheck)(this, TestPromise);
|
1607
2319
|
|
1608
|
-
_RSVP$Promise.apply(this, arguments);
|
1609
|
-
lastPromise = this;
|
1610
|
-
}
|
2320
|
+
var _this = (0, _emberBabel.possibleConstructorReturn)(this, _RSVP$Promise.apply(this, arguments));
|
1611
2321
|
|
1612
|
-
|
1613
|
-
|
1614
|
-
|
1615
|
-
callback in the last chained then.
|
1616
|
-
|
1617
|
-
This method should be returned by async helpers such as `wait`.
|
1618
|
-
|
1619
|
-
@public
|
1620
|
-
@for Ember.Test
|
1621
|
-
@method promise
|
1622
|
-
@param {Function} resolver The function used to resolve the promise.
|
1623
|
-
@param {String} label An optional string for identifying the promise.
|
1624
|
-
*/
|
2322
|
+
lastPromise = _this;
|
2323
|
+
return _this;
|
2324
|
+
}
|
1625
2325
|
|
1626
2326
|
TestPromise.prototype.then = function then(onFulfillment) {
|
1627
|
-
var _RSVP$Promise$
|
2327
|
+
var _RSVP$Promise$prototy;
|
1628
2328
|
|
1629
2329
|
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
1630
2330
|
args[_key - 1] = arguments[_key];
|
1631
2331
|
}
|
1632
2332
|
|
1633
|
-
return (_RSVP$Promise$
|
2333
|
+
return (_RSVP$Promise$prototy = _RSVP$Promise.prototype.then).call.apply(_RSVP$Promise$prototy, [this, function (result) {
|
1634
2334
|
return isolate(onFulfillment, result);
|
1635
2335
|
}].concat(args));
|
1636
2336
|
};
|
1637
2337
|
|
1638
2338
|
return TestPromise;
|
1639
|
-
}
|
2339
|
+
}(_emberRuntime.RSVP.Promise);
|
1640
2340
|
|
1641
2341
|
exports.default = TestPromise;
|
1642
2342
|
|
2343
|
+
|
2344
|
+
/**
|
2345
|
+
This returns a thenable tailored for testing. It catches failed
|
2346
|
+
`onSuccess` callbacks and invokes the `Ember.Test.adapter.exception`
|
2347
|
+
callback in the last chained then.
|
2348
|
+
|
2349
|
+
This method should be returned by async helpers such as `wait`.
|
2350
|
+
|
2351
|
+
@public
|
2352
|
+
@for Ember.Test
|
2353
|
+
@method promise
|
2354
|
+
@param {Function} resolver The function used to resolve the promise.
|
2355
|
+
@param {String} label An optional string for identifying the promise.
|
2356
|
+
*/
|
1643
2357
|
function promise(resolver, label) {
|
1644
2358
|
var fullLabel = 'Ember.Test.promise: ' + (label || '<Unknown Promise>');
|
1645
2359
|
return new TestPromise(resolver, fullLabel);
|
@@ -1656,7 +2370,6 @@ enifed('ember-testing/test/promise', ['exports', 'ember-runtime', 'ember-testing
|
|
1656
2370
|
@param {Mixed} The value to resolve
|
1657
2371
|
@since 1.2.0
|
1658
2372
|
*/
|
1659
|
-
|
1660
2373
|
function resolve(result, label) {
|
1661
2374
|
return TestPromise.resolve(result, label);
|
1662
2375
|
}
|
@@ -1686,7 +2399,7 @@ enifed('ember-testing/test/promise', ['exports', 'ember-runtime', 'ember-testing
|
|
1686
2399
|
if (value && value instanceof TestPromise || !promise) {
|
1687
2400
|
return value;
|
1688
2401
|
} else {
|
1689
|
-
return
|
2402
|
+
return (0, _run.default)(function () {
|
1690
2403
|
return resolve(promise).then(function () {
|
1691
2404
|
return value;
|
1692
2405
|
});
|
@@ -1698,10 +2411,9 @@ enifed('ember-testing/test/run', ['exports', 'ember-metal'], function (exports,
|
|
1698
2411
|
'use strict';
|
1699
2412
|
|
1700
2413
|
exports.default = run;
|
1701
|
-
|
1702
2414
|
function run(fn) {
|
1703
2415
|
if (!_emberMetal.run.currentRunLoop) {
|
1704
|
-
return _emberMetal.run(fn);
|
2416
|
+
return (0, _emberMetal.run)(fn);
|
1705
2417
|
} else {
|
1706
2418
|
return fn();
|
1707
2419
|
}
|
@@ -1715,6 +2427,7 @@ enifed('ember-testing/test/waiters', ['exports', 'ember-debug'], function (expor
|
|
1715
2427
|
exports.checkWaiters = checkWaiters;
|
1716
2428
|
exports.generateDeprecatedWaitersArray = generateDeprecatedWaitersArray;
|
1717
2429
|
|
2430
|
+
|
1718
2431
|
var contexts = [];
|
1719
2432
|
var callbacks = [];
|
1720
2433
|
|
@@ -1749,7 +2462,6 @@ enifed('ember-testing/test/waiters', ['exports', 'ember-debug'], function (expor
|
|
1749
2462
|
@param {Function} callback
|
1750
2463
|
@since 1.2.0
|
1751
2464
|
*/
|
1752
|
-
|
1753
2465
|
function registerWaiter(context, callback) {
|
1754
2466
|
if (arguments.length === 1) {
|
1755
2467
|
callback = context;
|
@@ -1773,7 +2485,6 @@ enifed('ember-testing/test/waiters', ['exports', 'ember-debug'], function (expor
|
|
1773
2485
|
@param {Function} callback
|
1774
2486
|
@since 1.2.0
|
1775
2487
|
*/
|
1776
|
-
|
1777
2488
|
function unregisterWaiter(context, callback) {
|
1778
2489
|
if (!callbacks.length) {
|
1779
2490
|
return;
|
@@ -1803,7 +2514,6 @@ enifed('ember-testing/test/waiters', ['exports', 'ember-debug'], function (expor
|
|
1803
2514
|
@static
|
1804
2515
|
@method checkWaiters
|
1805
2516
|
*/
|
1806
|
-
|
1807
2517
|
function checkWaiters() {
|
1808
2518
|
if (!callbacks.length) {
|
1809
2519
|
return false;
|
@@ -1828,7 +2538,8 @@ enifed('ember-testing/test/waiters', ['exports', 'ember-debug'], function (expor
|
|
1828
2538
|
}
|
1829
2539
|
|
1830
2540
|
function generateDeprecatedWaitersArray() {
|
1831
|
-
_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' });
|
2541
|
+
(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' }));
|
2542
|
+
|
1832
2543
|
|
1833
2544
|
var array = new Array(callbacks.length);
|
1834
2545
|
for (var i = 0; i < callbacks.length; i++) {
|
@@ -1841,9 +2552,22 @@ enifed('ember-testing/test/waiters', ['exports', 'ember-debug'], function (expor
|
|
1841
2552
|
return array;
|
1842
2553
|
}
|
1843
2554
|
});
|
2555
|
+
enifed('node-module', ['exports'], function(_exports) {
|
2556
|
+
var IS_NODE = typeof module === 'object' && typeof module.require === 'function';
|
2557
|
+
if (IS_NODE) {
|
2558
|
+
_exports.require = module.require;
|
2559
|
+
_exports.module = module;
|
2560
|
+
_exports.IS_NODE = IS_NODE
|
2561
|
+
} else {
|
2562
|
+
_exports.require = null;
|
2563
|
+
_exports.module = null;
|
2564
|
+
_exports.IS_NODE = IS_NODE
|
2565
|
+
}
|
2566
|
+
});
|
1844
2567
|
var testing = requireModule('ember-testing');
|
1845
2568
|
Ember.Test = testing.Test;
|
1846
2569
|
Ember.Test.Adapter = testing.Adapter;
|
1847
2570
|
Ember.Test.QUnitAdapter = testing.QUnitAdapter;
|
1848
2571
|
Ember.setupForTesting = testing.setupForTesting;
|
1849
2572
|
}());
|
2573
|
+
//# sourceMappingURL=ember-testing.map
|