Repository: ember-cli/ember-cli
Pull request #7430 (2017-11-09 09:32:46)

ember-try: Add `useYarn` flag if necessary
Resolves https://github.com/ember-cli/ember-cli/issues/7422


Patch:
diff --git a/blueprints/addon/files/addon-config/ember-try.js b/blueprints/addon/files/addon-config/ember-try.js
index 21f607970..cbda2051c 100644
--- a/blueprints/addon/files/addon-config/ember-try.js
+++ b/blueprints/addon/files/addon-config/ember-try.js
@@ -1,6 +1,7 @@
 /* eslint-env node */
 module.exports = {
-  scenarios: [
+  <% if (yarn) { %>useYarn: true,
+  <% } %>scenarios: [
     {
       name: 'ember-lts-2.8',
       bower: {


Test patch:
diff --git a/tests/acceptance/new-test.js b/tests/acceptance/new-test.js
index b06149e4f..bccfade33 100644
--- a/tests/acceptance/new-test.js
+++ b/tests/acceptance/new-test.js
@@ -415,6 +415,7 @@ describe('Acceptance: ember new', function() {
       ]);
 
       [
+        'config/ember-try.js',
         'tests/dummy/app/templates/application.hbs',
         '.travis.yml',
         'README.md',
@@ -436,6 +437,7 @@ describe('Acceptance: ember new', function() {
       ]);
 
       [
+        'config/ember-try.js',
         'tests/dummy/app/templates/application.hbs',
         '.travis.yml',
         'README.md',
diff --git a/tests/fixtures/addon/npm/config/ember-try.js b/tests/fixtures/addon/npm/config/ember-try.js
new file mode 100644
index 000000000..21f607970
--- /dev/null
+++ b/tests/fixtures/addon/npm/config/ember-try.js
@@ -0,0 +1,83 @@
+/* eslint-env node */
+module.exports = {
+  scenarios: [
+    {
+      name: 'ember-lts-2.8',
+      bower: {
+        dependencies: {
+          'ember': 'components/ember#lts-2-8'
+        },
+        resolutions: {
+          'ember': 'lts-2-8'
+        }
+      },
+      npm: {
+        devDependencies: {
+          'ember-source': null
+        }
+      }
+    },
+    {
+      name: 'ember-lts-2.12',
+      npm: {
+        devDependencies: {
+          'ember-source': '~2.12.0'
+        }
+      }
+    },
+    {
+      name: 'ember-release',
+      bower: {
+        dependencies: {
+          'ember': 'components/ember#release'
+        },
+        resolutions: {
+          'ember': 'release'
+        }
+      },
+      npm: {
+        devDependencies: {
+          'ember-source': null
+        }
+      }
+    },
+    {
+      name: 'ember-beta',
+      bower: {
+        dependencies: {
+          'ember': 'components/ember#beta'
+        },
+        resolutions: {
+          'ember': 'beta'
+        }
+      },
+      npm: {
+        devDependencies: {
+          'ember-source': null
+        }
+      }
+    },
+    {
+      name: 'ember-canary',
+      bower: {
+        dependencies: {
+          'ember': 'components/ember#canary'
+        },
+        resolutions: {
+          'ember': 'canary'
+        }
+      },
+      npm: {
+        devDependencies: {
+          'ember-source': null
+        }
+      }
+    },
+    {
+      name: 'ember-default',
+      npm: {
+        devDependencies: {}
+      }
+    }
+  ]
+};
diff --git a/tests/fixtures/addon/yarn/config/ember-try.js b/tests/fixtures/addon/yarn/config/ember-try.js
new file mode 100644
index 000000000..2862baf5b
--- /dev/null
+++ b/tests/fixtures/addon/yarn/config/ember-try.js
@@ -0,0 +1,84 @@
+/* eslint-env node */
+module.exports = {
+  useYarn: true,
+  scenarios: [
+    {
+      name: 'ember-lts-2.8',
+      bower: {
+        dependencies: {
+          'ember': 'components/ember#lts-2-8'
+        },
+        resolutions: {
+          'ember': 'lts-2-8'
+        }
+      },
+      npm: {
+        devDependencies: {
+          'ember-source': null
+        }
+      }
+    },
+    {
+      name: 'ember-lts-2.12',
+      npm: {
+        devDependencies: {
+          'ember-source': '~2.12.0'
+        }
+      }
+    },
+    {
+      name: 'ember-release',
+      bower: {
+        dependencies: {
+          'ember': 'components/ember#release'
+        },
+        resolutions: {
+          'ember': 'release'
+        }
+      },
+      npm: {
+        devDependencies: {
+          'ember-source': null
+        }
+      }
+    },
+    {
+      name: 'ember-beta',
+      bower: {
+        dependencies: {
+          'ember': 'components/ember#beta'
+        },
+        resolutions: {
+          'ember': 'beta'
+        }
+      },
+      npm: {
+        devDependencies: {
+          'ember-source': null
+        }
+      }
+    },
+    {
+      name: 'ember-canary',
+      bower: {
+        dependencies: {
+          'ember': 'components/ember#canary'
+        },
+        resolutions: {
+          'ember': 'canary'
+        }
+      },
+      npm: {
+        devDependencies: {
+          'ember-source': null
+        }
+      }
+    },
+    {
+      name: 'ember-default',
+      npm: {
+        devDependencies: {}
+      }
+    }
+  ]
+};