Skip to content

Commit f2727ca

Browse files
committed
Avoid global resolver in tests/node app setup
1 parent aa41d5e commit f2727ca

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

tests/node/app-boot-test.js

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ QUnit.module('App Boot', function (hooks) {
4141
QUnit.test('{{link-to}}', function (assert) {
4242
this.template('application', "<h1>{{#link-to 'photos'}}Go to photos{{/link-to}}</h1>");
4343
this.routes(function () {
44+
console.log("YAH");
4445
this.route('photos');
4546
});
4647

tests/node/helpers/setup-app.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,23 @@ function createApplication() {
9292

9393
let app = this.Ember.Application.extend().create({
9494
autoboot: false,
95+
Resolver: {
96+
create: specifier => {
97+
return this.registry[specifier];
98+
},
99+
},
95100
});
96101

97-
app.Router = this.Ember.Router.extend({
102+
let Router = this.Ember.Router.extend({
98103
location: 'none',
99104
});
100105

101106
if (this.routesCallback) {
102-
app.Router.map(this.routesCallback);
107+
Router.map(this.routesCallback);
103108
}
104109

110+
this.register('router:main', Router);
111+
105112
registerApplicationClasses(app, this.registry);
106113

107114
// Run application initializers

0 commit comments

Comments
 (0)