firebase / firebase-functions-test

MIT License
235 stars 53 forks source link

Update Dependency to Firebase Functions v6 #241

Open Nushio opened 2 months ago

Nushio commented 2 months ago

Version info

firebase-functions-test: 3.3.0

firebase-functions: 6.X

firebase-admin: 12.5.0

Test case

Upgrade Firebase Functions to 6.0 (Contains breaking change)

Tests won't pass anymore

Because the latest version changed the default entrypoint, imports of this library need to be rewritten to point to their v1 versions.

brunapereira commented 1 month ago

This is the error I'm getting:

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)

When i try to create a user:

  const userRecord: UserRecord = testEnv.auth.makeUserRecord({
    email: customer.email,
    displayName: customer.displayName,
    uid: userUid,
  });
unxavi commented 1 month ago

Oh no, we are migrating Firebase Functions to 6.0 and our cloud functions to V2 and this is breaking our tests

EnduringBeta commented 1 month ago

I created this PR that maybe should fix it: https://github.com/firebase/firebase-functions-test/pull/243

I don't exactly know what I'm doing, but I had to make similar changes in my own repo, so maybe it's this simple.

Nushio commented 1 week ago

It's been a couple of months with no response here. There's even a PR listed. Is there anyone working on this project or should we consider it abandoned?

AverageHelper commented 1 week ago

@EnduringBeta would you be willing to publish your fork under a namespace so that people can use that in the meantime?