@ember/edition-utils
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -0,1 +1,9 @@ | ||
## v1.1.1 (2019-09-15) | ||
#### :bug: Bug Fix | ||
* [#3](https://github.com/emberjs/ember-edition-utils/pull/3) Force setEdition / has to normalize (by lowercasing) ([@rwjblue](https://github.com/rwjblue)) | ||
#### Committers: 1 | ||
- Robert Jackson ([@rwjblue](https://github.com/rwjblue)) | ||
## v1.1.0 (2019-09-15) | ||
@@ -2,0 +10,0 @@ |
@@ -9,3 +9,3 @@ /** | ||
function setEdition(editionName) { | ||
process.env.EMBER_EDITION = editionName; | ||
process.env.EMBER_EDITION = editionName.toLowerCase(); | ||
} | ||
@@ -42,3 +42,5 @@ | ||
return edition; | ||
if (edition) { | ||
return edition.toLowerCase(); | ||
} | ||
} | ||
@@ -56,3 +58,4 @@ | ||
*/ | ||
function has(requestedEditionName) { | ||
function has(_requestedEditionName) { | ||
let requestedEditionName = _requestedEditionName.toLowerCase(); | ||
let edition = _getEdition(); | ||
@@ -59,0 +62,0 @@ |
{ | ||
"name": "@ember/edition-utils", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Utilities to detect if a given edition is in use in an ember-cli application.", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/emberjs/ember-octane-utils.git", |
13
test.js
@@ -27,2 +27,8 @@ const { setEdition, has, _getEdition } = require('./index'); | ||
}); | ||
test('normalizes the edition name that is passed in (lowercasing)', function(assert) { | ||
setEdition('OCTANE'); | ||
assert.strictEqual(getEdition(), 'octane'); | ||
}); | ||
}); | ||
@@ -41,2 +47,9 @@ | ||
test('should match case insensitively', function(assert) { | ||
setEdition('octane'); | ||
assert.ok(has('OCTANE')); | ||
}); | ||
test('should not "have" octane, when edition is classic', function(assert) { | ||
@@ -43,0 +56,0 @@ setEdition('classic'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9940
114