firebase/firebase-functions

firebase-functions 6.0.0 breaks firebase-functions-test

Closed this issue · 4 comments

Related issues

firebase/firebase-functions-test#241

A PR to fix it has been provided here:
firebase/firebase-functions-test#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

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not have all the information required by the template. Looks like you forgot to fill out some sections. Please update the issue with more information.

@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

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!

Closing as resolved in firebase/firebase-functions-test#243. Feel free to reopen/open a new issue in firebase-functions-test if the issue persists.