Sha256: dd72a2b33880e27bfe862e07b3cd372a050fab1ab894e859280acbd41627e655

Contents?: true

Size: 983 Bytes

Versions: 2

Compression:

Stored size: 983 Bytes

Contents

import TestResolverApplicationTestCase from './test-resolver-application';
import Application from '@ember/application';
import { assign } from '@ember/polyfills';
import { Router } from 'ember-routing';

export default class AutobootApplicationTestCase extends TestResolverApplicationTestCase {
  createApplication(options, MyApplication = Application) {
    let myOptions = assign(this.applicationOptions, options);
    let application = (this.application = MyApplication.create(myOptions));
    this.resolver = application.__registry__.resolver;

    if (this.resolver) {
      this.resolver.add('router:main', Router.extend(this.routerOptions));
    }

    return application;
  }

  visit(url) {
    return this.application.boot().then(() => {
      return this.applicationInstance.visit(url);
    });
  }

  get applicationInstance() {
    let { application } = this;

    if (!application) {
      return undefined;
    }

    return application.__deprecatedInstance__;
  }
}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
discourse-ember-source-3.5.1.1 dist/es/internal-test-helpers/lib/test-cases/autoboot-application.js
discourse-ember-source-3.5.1.0 dist/dist/es/internal-test-helpers/lib/test-cases/autoboot-application.js