So when I run npm run test_w_emulator
or npm run test_w_pure
my mocha test completes properly
package.json
"scripts": {
"test_w_emulator": "sh ./test.sh",
"test_w_pure": "mocha --reporter spec"
}
test.sh
firebase -P development emulators:exec "mocha"
if i run it from the command line i get the following error
Exception during run: TypeError: Cannot read properties of undefined (reading 'describe')
at exports.describe (_____functionsnode_modulesmochalibmocha.js:111:26)
at Object.<anonymous> (_____functionstestauth.test.ts:75:9)
at Module._compile (node:internal/modules/cjs/loader:1469:14)
at Module.m._compile (C:Users_____AppDataRoamingnvmv20.18.1node_modulests-nodesrcindex.ts:1618:23)
at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
at Object.require.extensions.<computed> [as .ts] (C:Users_____AppDataRoamingnvmv20.18.1node_modulests-nodesrcindex.ts:1621:12)
at Module.load (node:internal/modules/cjs/loader:1288:32)
at Function.Module._load (node:internal/modules/cjs/loader:1104:12)
at Module.require (node:internal/modules/cjs/loader:1311:19)
at require (node:internal/modules/helpers:179:18)
at Object.exports.requireOrImport (C:Users_____AppDataRoamingnvmv20.18.1node_modulesmochalibnodejsesm-utils.js:53:16)
at async Object.exports.loadFilesAsync (C:Users_____AppDataRoamingnvmv20.18.1node_modulesmochalibnodejsesm-utils.js:100:20)
at async singleRun (C:Users_____AppDataRoamingnvmv20.18.1node_modulesmochalibclirun-helpers.js:162:3)
at async Object.exports.handler (C:Users_____AppDataRoamingnvmv20.18.1node_modulesmochalibclirun.js:375:5)
i don’t fully understand why the commands work in the context of npm and not straight from the command line
i tried checking my node and java versions making sure they were in the compatibility list of the dependencies
Mykal Thomas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.