After completing my test suite, I encountered warnings when adding the test file to the npm scripts in the local package.json. The issue was that the package.json could not be located in the user directory.
npm ERR! path C:\Users\chris\package.json
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\chris\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\chris\AppData\Roaming\npm-cache\_logs\2018-08-04T16_59_06_479Z-debug.log
I wonder why it's searching for the package.json in the user directory instead of the current directory at C:\Users\chris\Google Drive\code projects\firebase-form\firebase-form. Could the issue lie with the script test command, which is "test": "mocha tests/firebase-listeners-tests.js"?
Even though I am executing npm test
from the local directory, nothing seems to be functioning correctly. Here's how I specified the test script in the package.json:
"test": "tests/resources tests.js"
Furthermore, here is the project's file structure:
firebase-form/
├── tests/
│ ├── firebase-listeners-tests.js
│ ├── resources tests.js
│ └── test_dependancy-fake_data_for_firebase.js
└── package.json
You may notice there isn't an entry point .js file yet because I haven't concluded my testing.
In addition, you can access the repository through this link: https://github.com/LeviathanTheGreat/firebase-form