# Mocha cannot find module 'can-connect/can/super-map/'

**URL:** <https://forums.bitovi.com/t/mocha-cannot-find-module-can-connect-can-super-map/551>\
**Category:** CanJS\
**Created:** [February 9, 2017, 12:40am UTC](https://forums.bitovi.com/t/mocha-cannot-find-module-can-connect-can-super-map/551 "2017-02-09T00:40:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nithanaroy](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/nithanaroy/32/225_2.png) [@Nithanaroy](https://forums.bitovi.com/u/Nithanaroy)\
**Post date:** [February 9, 2017, 12:40am UTC](https://forums.bitovi.com/t/mocha-cannot-find-module-can-connect-can-super-map/551/1 "2017-02-09T00:40:02Z")

</div>

My `npm test` command, `mocha components/*/*.cmd.test.js -r babel-register -r jsdom-global/register` fails as `mocha` cannot find `superMap` which is imported like so, `import superMap from "can-connect/can/super-map/";`. However `mocha` could find jquery which is imported like so, `import $ from "jquery";`. What am I missing?

---

<div class="post-metadata">

**Author:** ![chasen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/chasen/32/402_2.png) [@chasen](https://forums.bitovi.com/u/chasen)\
**Post date:** [February 9, 2017, 1:30am UTC](https://forums.bitovi.com/t/mocha-cannot-find-module-can-connect-can-super-map/551/2 "2017-02-09T01:30:22Z")

</div>

Does this work?

`import superMap from "can-connect/can/super-map/super-map";`

Excluding the file name when it repeats the last folder name is a StealJS feature, so that might be the issue if your code isn’t being loaded by StealJS.

---

<div class="post-metadata">

**Author:** ![Nithanaroy](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/nithanaroy/32/225_2.png) [@Nithanaroy](https://forums.bitovi.com/u/Nithanaroy)\
**Post date:** [February 9, 2017, 1:59am UTC](https://forums.bitovi.com/t/mocha-cannot-find-module-can-connect-can-super-map/551/3 "2017-02-09T01:59:15Z")

</div>

Works! I assumed JavaScript can import from a folder name. After you said revised how it works. Thank you.

---

<div class="post-metadata">

**Author:** ![Nithanaroy](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/nithanaroy/32/225_2.png) [@Nithanaroy](https://forums.bitovi.com/u/Nithanaroy)\
**Post date:** [February 9, 2017, 2:05am UTC](https://forums.bitovi.com/t/mocha-cannot-find-module-can-connect-can-super-map/551/4 "2017-02-09T02:05:51Z")

</div>

Could you explain why importing jquery works like that?

---

<div class="post-metadata">

**Author:** ![phillipskevin](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/phillipskevin/32/102_2.png) [@phillipskevin](https://forums.bitovi.com/u/phillipskevin)\
**Post date:** [February 9, 2017, 2:41am UTC](https://forums.bitovi.com/t/mocha-cannot-find-module-can-connect-can-super-map/551/5 "2017-02-09T02:41:43Z")

</div>

You can load jquery because they have set the `main` in their package.json: [https://github.com/jquery/jquery/blob/master/package.json#L6](https://github.com/jquery/jquery/blob/master/package.json#L6).

So when that package is required it loads the file pointed to by `main`.
