robert52 / mean-blueprints-cm

MEAN Blueprints - Contact manager application
0 stars 4 forks source link

Error: Cannot find module '../fixtures/user' #2

Open HHDog opened 8 years ago

HHDog commented 8 years ago

From PackPub product page, download the book source code archive file; "978178355945_Code.zip" Expand the archive, which creates the folder "MEANBlueprints_Code" Open a terminal in subfolder Chapter 1/mean-blueprints-cm-master Install the dependencies: $ npm install

Run the mocha command shown in the book: $ mocha test/integration/contact_test.js

MacBook-Pro:mean-blueprints-cm-master meh$ mocha test/integration/contact_test.js
/Users/meh/.nvm/versions/node/v6.2.2/lib/node_modules/mocha/lib/utils.js:634
        throw new Error("cannot resolve path (or pattern) '" + path + "'");
        ^

Error: cannot resolve path (or pattern) 'test/integration/contact_test.js'

PROBLEM #1: the mocha command arguments do not match the code repository folder and file names

Continuing... We change the mocha test execution command to refer to the correct folder and file: $ mocha tests/integration/contacts.test.js MacBook-Pro:mean-blueprints-cm-master meh$ mocha tests/integration/contacts.test.js module.js:442 throw err; ^

    Error: Cannot find module '../fixtures/user'

PROBLEM #2: The error shows that there is no "user" module. Inspecting the repo, you find there also is no "fixture" folder.

Need the fixtures folder and whatever code should be in it in order to get this to run.

robert52 commented 8 years ago

Thanks @HHDog for the feedback, probably there is a typo in the book for the file name, keep a close eye on the git repos, as it's an open source project, changes will keep coming in. Also you are welcomed to make pull requests.

For the missing fixtures file please see the resolution found under this issue https://github.com/robert52/mean-blueprints-cm/issues/1