Repository: ember-cli/ember-cli
Pull request #8005 (2018-08-31 12:45:30)

[BUGFIX] Continue to use jQuery in Ember 2.x scenarios
It turns out the default blueprint for addons generates an addon whose 2.X scenarios in ember-try fail by default.

In https://github.com/ember-cli/ember-cli/commit/ca68ba3a5c5f8781a3650b553cf2050afc8b69f7#diff-d2dc84345b41f0668236a56410bcc7bc addons began to be tested without jQuery by default, which is great, but in Ember 2.X we **also** need to install the `ember-native-dom-event-dispatcher`.

I still suspect this may not help the tests for Ember 2.12, but let's start from here.



rwjblue: This is looking good, I'd like to get this targetted at `beta` branch (which will require you to update the PR target *and* drop out any additional commits that are on master where you forked from and beta).

Also, can you confirm if we do or do not need to also add `@ember/jquery` to each of these 2.x scenarios? It seems to me that we _should_ have it in there, but I just wanting to make sure we don't emit warnings about it during these try scenarios...

Patch:
diff --git a/blueprints/addon/files/addon-config/ember-try.js b/blueprints/addon/files/addon-config/ember-try.js
index 961e070b1..45ecafaa8 100644
--- a/blueprints/addon/files/addon-config/ember-try.js
+++ b/blueprints/addon/files/addon-config/ember-try.js
@@ -11,26 +11,26 @@ module.exports = function() {
     return {
       <% if (yarn) { %>useYarn: true,
       <% } %>scenarios: [
-        {
-          name: 'ember-lts-2.12',
-          npm: {
-            devDependencies: {
-              'ember-source': '~2.12.0'
-            }
-          }
-        },
         {
           name: 'ember-lts-2.16',
+          env: {
+            EMBER_OPTIONAL_FEATURES: JSON.stringify({ 'jquery-integration': true }),
+          },
           npm: {
             devDependencies: {
+              '@ember/jquery': '^0.5.1',
               'ember-source': '~2.16.0'
             }
           }
         },
         {
           name: 'ember-lts-2.18',
+          env: {
+            EMBER_OPTIONAL_FEATURES: JSON.stringify({ 'jquery-integration': true }),
+          },
           npm: {
             devDependencies: {
+              '@ember/jquery': '^0.5.1',
               'ember-source': '~2.18.0'
             }
           }


Test patch:
diff --git a/tests/fixtures/addon/npm/config/ember-try.js b/tests/fixtures/addon/npm/config/ember-try.js
index d2620d11b..7742969d4 100644
--- a/tests/fixtures/addon/npm/config/ember-try.js
+++ b/tests/fixtures/addon/npm/config/ember-try.js
@@ -10,26 +10,26 @@ module.exports = function() {
   ]).then((urls) => {
     return {
       scenarios: [
-        {
-          name: 'ember-lts-2.12',
-          npm: {
-            devDependencies: {
-              'ember-source': '~2.12.0'
-            }
-          }
-        },
         {
           name: 'ember-lts-2.16',
+          env: {
+            EMBER_OPTIONAL_FEATURES: JSON.stringify({ 'jquery-integration': true }),
+          },
           npm: {
             devDependencies: {
+              '@ember/jquery': '^0.5.1',
               'ember-source': '~2.16.0'
             }
           }
         },
         {
           name: 'ember-lts-2.18',
+          env: {
+            EMBER_OPTIONAL_FEATURES: JSON.stringify({ 'jquery-integration': true }),
+          },
           npm: {
             devDependencies: {
+              '@ember/jquery': '^0.5.1',
               'ember-source': '~2.18.0'
             }
           }
diff --git a/tests/fixtures/addon/yarn/config/ember-try.js b/tests/fixtures/addon/yarn/config/ember-try.js
index 7e8ab4c4a..2ca5a5594 100644
--- a/tests/fixtures/addon/yarn/config/ember-try.js
+++ b/tests/fixtures/addon/yarn/config/ember-try.js
@@ -11,26 +11,26 @@ module.exports = function() {
     return {
       useYarn: true,
       scenarios: [
-        {
-          name: 'ember-lts-2.12',
-          npm: {
-            devDependencies: {
-              'ember-source': '~2.12.0'
-            }
-          }
-        },
         {
           name: 'ember-lts-2.16',
+          env: {
+            EMBER_OPTIONAL_FEATURES: JSON.stringify({ 'jquery-integration': true }),
+          },
           npm: {
             devDependencies: {
+              '@ember/jquery': '^0.5.1',
               'ember-source': '~2.16.0'
             }
           }
         },
         {
           name: 'ember-lts-2.18',
+          env: {
+            EMBER_OPTIONAL_FEATURES: JSON.stringify({ 'jquery-integration': true }),
+          },
           npm: {
             devDependencies: {
+              '@ember/jquery': '^0.5.1',
               'ember-source': '~2.18.0'
             }
           }