Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { dasherize } from '@ember/string';
import { assign } from '@ember/polyfills';
import { setRegistry } from '../../resolver';
import { setResolver, setApplication } from '@ember/test-helpers';
import require from 'require';
import App from '../../app';
import config from '../../config/environment';
const AppConfig = assign({ autoboot: false }, config.APP);
export const application = App.create(AppConfig);
export const resolver = application.Resolver.create({
namespace: application,
isResolverFromTestHelpers: true,
});
setResolver(resolver);
setApplication(application);
export function setResolverRegistry(registry) {
setRegistry(registry);
}
export default {
create() {
return resolver;
},
};
export function createCustomResolver(registry) {
if (require.has('ember-native-dom-event-dispatcher')) {
// the raw value looked up by ember and these test helpers
registry['event_dispatcher:main'] = require('ember-native-dom-event-dispatcher').default;
import RSVP from 'rsvp';
import resolver from './helpers/resolver';
import { setResolver } from '@ember/test-helpers';
import { start } from 'ember-qunit';
import QUnit from 'qunit';
import DS from 'ember-data';
import { wait, asyncEqual, invokeAsync } from 'dummy/tests/helpers/async';
// TODO get us to a setApplication world instead
// seems to require killing off createStore
setResolver(resolver);
const { assert } = QUnit;
const transforms = {
boolean: DS.BooleanTransform.create(),
date: DS.DateTransform.create(),
number: DS.NumberTransform.create(),
string: DS.StringTransform.create(),
};
QUnit.begin(() => {
RSVP.configure('onerror', reason => {
// only print error messages if they're exceptions;
// otherwise, let a future turn of the event loop
// handle the error.
if (reason && reason instanceof Error) {
throw reason;
import resolver from './helpers/resolver';
import { setResolver } from '@ember/test-helpers';
import { start } from 'ember-qunit';
setResolver(resolver);
start();
import resolver from './helpers/resolver';
import {
setResolver
} from '@ember/test-helpers';
import { start } from 'ember-cli-qunit';
setResolver(resolver);
start();
import resolver from './helpers/resolver';
import { setResolver } from '@ember/test-helpers';
import { start } from 'ember-cli-qunit';
setResolver(resolver);
start();
import resolver from './helpers/resolver';
import { setResolver } from '@ember/test-helpers';
import { start } from 'ember-cli-qunit';
setResolver(resolver);
start();
let aArgs = Array.prototype.slice.call(arguments, 1);
let fToBind = this;
let FNOP = function () {};
let fBound = function () {
let thisObj = (this instanceof FNOP && oThis) ? this : oThis;
let args = aArgs.concat(Array.prototype.slice.call(arguments));
fToBind.apply(thisObj, args);
};
FNOP.prototype = this.prototype;
fBound.prototype = new FNOP();
};
})();
setResolver(resolver);
start();
import resolver from './helpers/resolver';
import {
setResolver
} from '@ember/test-helpers';
import { start } from 'ember-cli-qunit';
setResolver(resolver);
start();
import {
setResolver
} from '@ember/test-helpers';
import resolver from './helpers/resolver';
import start from 'ember-exam/test-support/start';
const oppositeFramework = !require.has('ember-qunit') ? 'qunit' : 'mocha';
Object.keys(require.entries).forEach((entry) => {
if (entry.indexOf(oppositeFramework) !== -1) {
delete require.entries[entry];
}
});
setResolver(resolver);
start();
import resolver from './helpers/resolver';
import { setResolver } from '@ember/test-helpers';
import { start } from 'ember-cli-qunit';
setResolver(resolver);
start();