-
-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not register a router service for Ember <1.13
Versions of Ember prior to 1.13 require a full router booted by the app, or no router at all. This ensures they receive no router at all instead of the 1.13-safe one.
- Loading branch information
Showing
4 changed files
with
22 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import Ember from 'ember'; | ||
|
||
export default function hasEmberVersion(major, minor) { | ||
var numbers = Ember.VERSION.split('-')[0].split('.'); | ||
var actualMajor = parseInt(numbers[0], 10); | ||
var actualMinor = parseInt(numbers[1], 10); | ||
return actualMajor > major || (actualMajor === major && actualMinor >= minor); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import Ember from 'ember'; | ||
import { TestModuleForComponent } from 'ember-test-helpers'; | ||
import hasEmberVersion from 'ember-test-helpers/has-ember-version'; | ||
import test from 'tests/test-support/qunit-test'; | ||
import qunitModuleFor from 'tests/test-support/qunit-module-for'; | ||
import { setResolverRegistry } from 'tests/test-support/resolver'; | ||
|
@@ -237,7 +238,7 @@ moduleForComponent('changing-color', 'component:changing-color -- handles closur | |
integration: true | ||
}); | ||
|
||
if (!/^1\.(11|12)/.test(Ember.VERSION)) { | ||
if (hasEmberVersion(1,13)) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
mixonic
Author
Member
|
||
test('handles a closure actions', function() { | ||
expect(1); | ||
this.on('colorChange', function(arg) { equal(arg, 'foo'); }); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixonic looks like this change broke controller and route tests in 1.11 and 1.12 since they have an injection for
router:main
. Also, on these versions, resolveresolver.resolve('router:main');
already returns the full router, not the 1.13 safe router.