Skip to content

Instantly share code, notes, and snippets.

@raido
Created November 4, 2018 21:01
Show Gist options
  • Save raido/8b71ffc275c261b302ae638658b6bd9c to your computer and use it in GitHub Desktop.
Save raido/8b71ffc275c261b302ae638658b6bd9c to your computer and use it in GitHub Desktop.
define('foo/tests/acceptance/foo-test', ['qunit', '@ember/test-helpers', 'ember-qunit'], function (_qunit, _testHelpers, _emberQunit) {
'use strict';
function _asyncToGenerator(fn) {
return function () {
var gen = fn.apply(this, arguments);
return new Promise(function (resolve, reject) {
function step(key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
return Promise.resolve(value).then(function (value) {
step("next", value);
}, function (err) {
step("throw", err);
});
}
}
return step("next");
});
};
}
(0, _qunit.module)('Acceptance | foo', function (hooks) {
(0, _emberQunit.setupApplicationTest)(hooks);
(0, _qunit.test)('visiting /foo', function () {
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(assert) {
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return (0, _testHelpers.visit)('/foo');
case 2:
assert.equal((0, _testHelpers.currentURL)(), '/foo');
case 3:
case 'end':
return _context.stop();
}
}
}, _callee, this);
}));
return function (_x) {
return _ref.apply(this, arguments);
};
}());
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment