firebase / firebase/quickstart-testing

Emulator Suite in Google Cloud Shell - TypeError: firebase.initializeTestApp not a function

Abierto
#241 1 comentario 0 reacciones 1 asignado Reclamado por @jhuleatt Ver en GitHub
bug
Lenguaje dominante
JavaScript
Estrellas
368
Forks
125
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

### Environment info

**firebase-tools:**

**Platform:** Windows 11 / Google Cloud Shell - Emulator Suite, CS Walkthrough

### Test case

Trying to just follow the quickstart testing through Cloud Shell for rules. Getting to step 4 of 11 and it gives the error in the subject line.

"TypeError: firebase.initializeTestApp not a function"

I've looked through the node_modules folder for all the test modules and, no it isn't in the module that the script is looking through. I did see that sometime recently, in a closed issue, initializeTestApp was moved to a different module than it was in before. Perhaps this is the issue.

### Steps to reproduce

Just follow the Cloud Shell tutorial explicitly

### Expected behavior

The Mocha test starts and runs. Test App is initialized. The CS Walkthrough works out of the box.

### Actual behavior

```
jollyren@cloudshell:~/rules-tutorial/quickstart-testing/cs-walkthrough/functions$ npm run test

> test
> mocha --timeout 5000 --exit

/home/jollyren/rules-tutorial/quickstart-testing/cs-walkthrough/functions/node_modules/mocha/node_modules/yargs/yargs.js:1163
else throw err
^

TypeError: firebase.initializeTestApp is not a function
at Suite. (/home/jollyren/rules-tutorial/quickstart-testing/cs-walkthrough/functions/test.js:53:23)
at Object.create (/home/jollyren/rules-tutorial/quickstart-testing/cs-walkthrough/functions/node_modules/mocha/lib/interfaces/common.js:140:19)
at context.describe.context.context (/home/jollyren/rules-tutorial/quickstart-testing/cs-walkthrough/functions/node_modules/mocha/lib/interfaces/bdd.js:42:27)
at Object. (/home/jollyren/rules-tutorial/quickstart-testing/cs-walkthrough/functions/test.js:51:1)
at Module._compile (node:internal/modules/cjs/loader:1109:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
at Module.load (node:internal/modules/cjs/loader:989:32)
at Function.Module._load (node:internal/modules/cjs/loader:829:14)
at Module.require (node:internal/modules/cjs/loader:1013:19)
at require (node:internal/modules/cjs/helpers:93:18)
at /home/jollyren/rules-tutorial/quickstart-testing/cs-walkthrough/functions/node_modules/mocha/lib/mocha.js:334:36
at Array.forEach ()
at Mocha.loadFiles (/home/jollyren/rules-tutorial/quickstart-testing/cs-walkthrough/functions/node_modules/mocha/lib/mocha.js:331:14)
at Mocha.run (/home/jollyren/rules-tutorial/quickstart-testing/cs-walkthrough/functions/node_modules/mocha/lib/mocha.js:811:10)
at Object.exports.singleRun (/home/jollyren/rules-tutorial/quickstart-testing/cs-walkthrough/functions/node_modules/mocha/lib/cli/run-helpers.js:108:16)
at exports.runMocha (/home/jollyren/rules-tutorial/quickstart-testing/cs-walkthrough/functions/node_modules/mocha/lib/cli/run-helpers.js:142:13)
at Object.exports.handler (/home/jollyren/rules-tutorial/quickstart-testing/cs-walkthrough/functions/node_modules/mocha/lib/cli/run.js:292:3)
at Object.runCommand (/home/jollyren/rules-tutorial/quickstart-testing/cs-walkthrough/functions/node_modules/mocha/node_modules/yargs/lib/command.js:242:26)
at Object.parseArgs [as _parseArgs] (/home/jollyren/rules-tutorial/quickstart-testing/cs-walkthrough/functions/node_modules/mocha/node_modules/yargs/yargs.js:1104:24)
at Object.parse (/home/jollyren/rules-tutorial/quickstart-testing/cs-walkthrough/functions/node_modules/mocha/node_modules/yargs/yargs.js:566:25)
at Object.exports.main (/home/jollyren/rules-tutorial/quickstart-testing/cs-walkthrough/functions/node_modules/mocha/lib/cli/cli.js:68:6)
at Object. (/home/jollyren/rules-tutorial/quickstart-testing/cs-walkthrough/functions/node_modules/mocha/bin/mocha:164:29)
at Module._compile (node:internal/modules/cjs/loader:1109:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
at Module.load (node:internal/modules/cjs/loader:989:32)
at Function.Module._load (node:internal/modules/cjs/loader:829:14)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
at node:internal/main/run_main_module:17:47

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.