# All default Component Integration Tests are (4, 0, 4) undefined

**URL:** <https://discuss.emberjs.com/t/all-default-component-integration-tests-are-4-0-4-undefined/10097>\
**Category:** Testing\
**Created:** [March 9, 2016, 11:27pm UTC](https://discuss.emberjs.com/t/all-default-component-integration-tests-are-4-0-4-undefined/10097 "2016-03-09T23:27:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kyleshevlin](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/kyleshevlin/32/11839_2.png) [@kyleshevlin](https://discuss.emberjs.com/u/kyleshevlin)\
**Post date:** [March 9, 2016, 11:27pm UTC](https://discuss.emberjs.com/t/all-default-component-integration-tests-are-4-0-4-undefined/10097/1 "2016-03-09T23:27:33Z")

</div>

I am completely new to testing in Ember (testing in general). I am following the Ember 2.x course at Front End Masters and I have generated several components via ember-cli. When I go to `http://localhost:4200/tests`, each of these components returns an identical set of errors.

```
Integration | Component | my component it renders (4, 0, 4)
1. Uncaught TypeError: Cannot read property 'extend' of undefined
Source: http://localhost:4200/assets/vendor.js:43347

2. Died on test #2 at Object.test (http://localhost:4200/assets/test-support.js:1997:11)
at http://localhost:4200/assets/github-ui.js:2076:15
at mod.state (http://localhost:4200/assets/vendor.js:150:29)
at tryFinally (http://localhost:4200/assets/vendor.js:30:14)
at requireModule (http://localhost:4200/assets/vendor.js:148:5)
at Object.TestLoader.require (http://localhost:4200/assets/test-loader.js:29:9)
at Object.TestLoader.loadModules (http://localhost:4200/assets/test-loader.js:21:18): Cannot read property 'render' of undefined
Source: 	
TypeError: Cannot read property 'render' of undefined
at http://localhost:4200/assets/github-ui.js:2082:9
at Object.wrapper (http://localhost:4200/assets/test-support.js:1979:29)
at Object.Test.run (http://localhost:4200/assets/test-support.js:3660:28)
at http://localhost:4200/assets/test-support.js:3789:11
at process (http://localhost:4200/assets/test-support.js:3348:24)
at begin (http://localhost:4200/assets/test-support.js:3393:2)
at http://localhost:4200/assets/test-support.js:3409:4

3. Uncaught TypeError: Cannot read property 'subject' of undefined
Source: http://localhost:4200/assets/vendor.js:43347

4. Expected 2 assertions, but 3 were run
Source: 	
at Object.test (http://localhost:4200/assets/test-support.js:1997:11)
at http://localhost:4200/assets/github-ui.js:2076:15
at mod.state (http://localhost:4200/assets/vendor.js:150:29)
at tryFinally (http://localhost:4200/assets/vendor.js:30:14)
at requireModule (http://localhost:4200/assets/vendor.js:148:5)
at Object.TestLoader.require (http://localhost:4200/assets/test-loader.js:29:9)
at Object.TestLoader.loadModules (http://localhost:4200/assets/test-loader.js:21:18)

```

These are the default tests. I have not made any modifications. These components are working as expected in my app. What do I need to do?

Additional details:

```
DEBUG: -------------------------------
DEBUG: Ember : 2.4.1
DEBUG: Ember Data : 2.5.0-beta.1+1327e0755b
DEBUG: jQuery : 1.12.1
DEBUG: -------------------------------

```

---

<div class="post-metadata">

**Author:** ![kyleshevlin](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/kyleshevlin/32/11839_2.png) [@kyleshevlin](https://discuss.emberjs.com/u/kyleshevlin)\
**Post date:** [March 10, 2016, 12:27am UTC](https://discuss.emberjs.com/t/all-default-component-integration-tests-are-4-0-4-undefined/10097/2 "2016-03-10T00:27:28Z")

</div>

Solved my own issue.

Turns out that despite installing the latest version of ember-cli, it was still operating on ember cli 1.13.1; I think the culprit was NVM. Since I don’t need NVM, I removed it from my system, reinstalled node, npm and bower, and then was able to install the right version of ember-cli for the project.

After following the project upgrade instructions, I was able to get ember-cli up to version 2.4.2 and the tests are now running as expected.

---

<div class="post-metadata">

**Author:** ![andrew1](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/andrew1/32/10636_2.png) [@andrew1](https://discuss.emberjs.com/u/andrew1)\
**Post date:** [March 10, 2016, 11:37pm UTC](https://discuss.emberjs.com/t/all-default-component-integration-tests-are-4-0-4-undefined/10097/3 "2016-03-10T23:37:49Z")

</div>

The issue is that when you type `$ember` you get the globally installed version of `ember-cli`. My preferred way to avoid this is to create scripts in the `package.json` file in run them:

```
// package.json
...
"scripts":{
   "test": "ember test",
 ....

```

Then, when you run `npm test` node will use the `ember` executable in your local `node_moduels` directory rather than the globally installed one.

I"ve also got this neat little alias:

```
alias npm-exec='PATH=$(npm bin):$PATH'

```

You can use it to run executables: `npm-exec ember` and it will always use the executable that is local to the project rather than the global.

---

<div class="post-metadata">

**Author:** ![kyleshevlin](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/kyleshevlin/32/11839_2.png) [@kyleshevlin](https://discuss.emberjs.com/u/kyleshevlin)\
**Post date:** [March 11, 2016, 8:10am UTC](https://discuss.emberjs.com/t/all-default-component-integration-tests-are-4-0-4-undefined/10097/4 "2016-03-11T08:10:15Z")

</div>

Thank you for the answer. I’ll keep this in mind should I ever have to run Ember apps with different versions.
