Skip to content

Commit

Permalink
Avoid global resolver in tests/node app setup
Browse files Browse the repository at this point in the history
  • Loading branch information
mixonic committed Jul 22, 2021
1 parent aa41d5e commit f2727ca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions tests/node/app-boot-test.js
Expand Up @@ -41,6 +41,7 @@ QUnit.module('App Boot', function (hooks) {
QUnit.test('{{link-to}}', function (assert) {
this.template('application', "<h1>{{#link-to 'photos'}}Go to photos{{/link-to}}</h1>");
this.routes(function () {
console.log("YAH");
this.route('photos');
});

Expand Down
11 changes: 9 additions & 2 deletions tests/node/helpers/setup-app.js
Expand Up @@ -92,16 +92,23 @@ function createApplication() {

let app = this.Ember.Application.extend().create({
autoboot: false,
Resolver: {
create: specifier => {
return this.registry[specifier];
},
},
});

app.Router = this.Ember.Router.extend({
let Router = this.Ember.Router.extend({
location: 'none',
});

if (this.routesCallback) {
app.Router.map(this.routesCallback);
Router.map(this.routesCallback);
}

this.register('router:main', Router);

registerApplicationClasses(app, this.registry);

// Run application initializers
Expand Down

0 comments on commit f2727ca

Please sign in to comment.