define('ember-qunit/legacy-2-x/qunit-module', ['exports', 'qunit'], function (exports, _qunit) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createModule = createModule;
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
return typeof obj;
} : function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
function noop() {}
function callbackFor(name, callbacks) {
if ((typeof callbacks === 'undefined' ? 'undefined' : _typeof(callbacks)) !== 'object') {
return noop;
}
if (!callbacks) {
return noop;
}
var callback = noop;
if (callbacks[name]) {
callback = callbacks[name];
delete callbacks[name];
}
return callback;
}
function createModule(Constructor, name, description, callbacks) {
if (!callbacks && (typeof description === 'undefined' ? 'undefined' : _typeof(description)) === 'object') {
callbacks = description;
description = name;
}
var _before = callbackFor('before', callbacks);
var _beforeEach = callbackFor('beforeEach', callbacks);
var _afterEach = callbackFor('afterEach', callbacks);
var _after = callbackFor('after', callbacks);
var module;
var moduleName = typeof description === 'string' ? description : name;
(0, _qunit.module)(moduleName, {
before: function before() {
// storing this in closure scope to avoid exposing these
// private internals to the test context
module = new Constructor(name, description, callbacks);
return _before.apply(this, arguments);
},
beforeEach: function beforeEach() {
var _module,
_this = this,
_arguments = arguments;
// provide the test context to the underlying module
module.setContext(this);
return (_module = module).setup.apply(_module, arguments).then(function () {
return _beforeEach.apply(_this, _arguments);
});
},
afterEach: function afterEach() {
var _arguments2 = arguments;
var result = _afterEach.apply(this, arguments);
return Ember.RSVP.resolve(result).then(function () {
var _module2;
return (_module2 = module).teardown.apply(_module2, _arguments2);
});
},
after: function after() {
try {
return _after.apply(this, arguments);
} finally {
_after = _afterEach = _before = _beforeEach = callbacks = module = null;
}
}
});
}
});
# |
Change |
User |
Description |
Committed |
|
#1
|
23539 |
jenbottom |
Adding the basic code for ember test appk, created with 'ember new' command |
|
|