File tree 2 files changed +19
-3
lines changed
2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change 6
6
@param {string } editionName the Edition name that your application is authored in
7
7
*/
8
8
function setEdition ( editionName ) {
9
- process . env . EMBER_EDITION = editionName ;
9
+ process . env . EMBER_EDITION = editionName . toLowerCase ( ) ;
10
10
}
11
11
12
12
/**
@@ -38,7 +38,9 @@ function _getEdition() {
38
38
}
39
39
}
40
40
41
- return edition ;
41
+ if ( edition ) {
42
+ return edition . toLowerCase ( ) ;
43
+ }
42
44
}
43
45
44
46
/**
@@ -51,7 +53,8 @@ function _getEdition() {
51
53
52
54
@param {string } requestedEditionName the Edition name that the application/addon is requesting
53
55
*/
54
- function has ( requestedEditionName ) {
56
+ function has ( _requestedEditionName ) {
57
+ let requestedEditionName = _requestedEditionName . toLowerCase ( ) ;
55
58
let edition = _getEdition ( ) ;
56
59
57
60
if ( requestedEditionName === 'classic' ) {
Original file line number Diff line number Diff line change @@ -24,6 +24,12 @@ QUnit.module('@ember/edition-utils', function(hooks) {
24
24
25
25
assert . strictEqual ( getEdition ( ) , 'octane' ) ;
26
26
} ) ;
27
+
28
+ test ( 'normalizes the edition name that is passed in (lowercasing)' , function ( assert ) {
29
+ setEdition ( 'OCTANE' ) ;
30
+
31
+ assert . strictEqual ( getEdition ( ) , 'octane' ) ;
32
+ } ) ;
27
33
} ) ;
28
34
29
35
QUnit . module ( 'has' , function ( ) {
@@ -37,6 +43,13 @@ QUnit.module('@ember/edition-utils', function(hooks) {
37
43
assert . ok ( has ( 'octane' ) ) ;
38
44
} ) ;
39
45
46
+ test ( 'should match case insensitively' , function ( assert ) {
47
+ setEdition ( 'octane' ) ;
48
+
49
+ assert . ok ( has ( 'OCTANE' ) ) ;
50
+ } ) ;
51
+
52
+
40
53
test ( 'should not "have" octane, when edition is classic' , function ( assert ) {
41
54
setEdition ( 'classic' ) ;
42
55
You can’t perform that action at this time.
0 commit comments