Test addon from addon


how can i run test cases (unit, acceptance…)of addon project. i used “ember try:each” but it is testing against various other versions of ember.


That’s the point of ember-try, it runs your test suite against multiple versions of ember to make sure the addon is compatible with each ember version in the configured range. If you just want to run the test suite with the primary dependent version run ember t or look in your package.json file to see what the test script looks like and run it with npm run test or yarn test (if you use yarn)

This is what i get if i do ember t

this is the error log:

this is my package.json

Looks like it’s choking on the spread operator which means you may have an out of date babel dependency.

If ember try:each is working you could just run one of the scenarios with ember try:one <scenario>. Look in config/ember-try for your scenarios

If i do ember try:ember-default

ember try:ember-default DEPRECATION: ember-cli-babel 5.x has been deprecated. Please upgrade to at least ember-cli-babel 6.6. Version 5.2.8 located: @cibc/simplii-credit-card-engine → ember-sinon → ember-cli-babel DEPRECATION: An addon is trying to access project.nodeModulesPath. This is not a reliable way to discover npm modules. Instead, consider doing: require(“resolve”).sync(something, { basedir: project.root }). Accessed from: DependencyVersionChecker.NPMDependencyVersionChecker (/Users/soniya.passicibc.com/Documents/ember_project/simplii-credit-card-engine/node_modules/ember-sinon/node_modules/ember-cli-version-checker/src/npm-dependency-version-checker.js:11:32) The specified command try:ember-default is invalid. For available options, see ember help.

my /config/ember-try.js looks like this

module.exports = { scenarios: [ { name: ‘ember-lts-2.12’, npm: { devDependencies: { ‘ember-source’: ‘~2.12.0’ } } }, { name: ‘ember-lts-2.16’, npm: { devDependencies: { ‘ember-source’: ‘~2.16.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: {} } } ] };

per my above comment i think it should be ember try:one ember-default

try is the ember cli command, :one is the “sub command”, and ember-default is the argument

1 Like

same error broccoliBuilderErrorStack: [undefined]

Try updating ember-sinon, since that is mentioned in the deprecation warning about having an old version of babel (5). That will likely solve the spread operator error. If not you could add a babel plugin explicitly but you shouldn’t have to do that