Sha256: 689751db3f706c52c42ccc87e5ee3cb962de7f7a3171c618e5dbf6d1def00a32
Contents?: true
Size: 1.17 KB
Versions: 2
Compression:
Stored size: 1.17 KB
Contents
import AbstractApplicationTestCase from './abstract-application'; import DefaultResolver from '@ember/application/globals-resolver'; import Application from '@ember/application'; import { setTemplates, setTemplate } from 'ember-glimmer'; import { assign } from '@ember/polyfills'; import { Router } from 'ember-routing'; export default class ApplicationTestCase extends AbstractApplicationTestCase { createApplication() { let application = (this.application = Application.create(this.applicationOptions)); application.Router = Router.extend(this.routerOptions); return application; } get applicationOptions() { return assign(super.applicationOptions, { name: 'TestApp', autoboot: false, Resolver: DefaultResolver, }); } afterEach() { setTemplates({}); return super.afterEach(); } get appRouter() { return this.applicationInstance.lookup('router:main'); } transitionTo() { return this.runTask(() => { return this.appRouter.transitionTo(...arguments); }); } addTemplate(name, templateString) { let compiled = this.compile(templateString); setTemplate(name, compiled); return compiled; } }
Version data entries
2 entries across 2 versions & 1 rubygems