firebase / firebase-functions

Firebase SDK for Cloud Functions
https://firebase.google.com/docs/functions/
MIT License
1.03k stars 204 forks source link

firebase-functions 6.0.0 breaks firebase-functions-test #1648

Open IchordeDionysos opened 1 day ago

IchordeDionysos commented 1 day ago

Related issues

https://github.com/firebase/firebase-functions-test/issues/241

A PR to fix it has been provided here: https://github.com/firebase/firebase-functions-test/pull/243

[REQUIRED] Version info

node: 20

firebase-functions: 6.0.0

firebase-tools: 13.27.0

firebase-admin: 13.0.1

firebase-functions-test: 3.3.0

[REQUIRED] Test case

  1. Install firebase-functions >6.0.0
  2. Install firebase-functions-test any version, e.g. 3.3.0
  3. Run the following code:
  const userRecord: UserRecord = testEnv.auth.makeUserRecord({
    email: customer.email,
    displayName: customer.displayName,
    uid: userUid,
  });

[REQUIRED] Steps to reproduce

[REQUIRED] Expected behavior

No errors are thrown.

[REQUIRED] Actual behavior

Errors are thrown due to the import requirements changing.

TypeError: Cannot read properties of undefined (reading 'userRecordConstructor')
      at Object.makeUserRecord (node_modules/firebase-functions-test/lib/providers/auth.js:30:38)
      at mockCustomer (test/helpers/customers.ts:10:47)
      at Context.<anonymous> (test/purchases/handlers/savePurchase.spec.ts:11:38)
      at processImmediate (node:internal/timers:478:21)
      at process.callbackTrampoline (node:internal/async_hooks:130:17)

Were you able to successfully deploy your functions?

n/a

google-oss-bot commented 1 day ago

I found a few problems with this issue:

IchordeDionysos commented 1 day ago

@blidd-google @taeold this breaks our and many others use-cases and prevents them from upgrading to firebase-functions 6.0.0.

Would be amazing if you could work on a fix there ☺️ Thanks already 🫶

Nushio commented 10 hours ago

Been holding off from creating an issue here, but thanks for this! I wish more support was provided to the firebase-functions-test project, it's very important for established Firebase projects!