When I use the wrap function from firebase-functions-test I got this error message
Error Message
TypeError: Cannot read properties of undefined (reading 'length')
at isV2CloudFunction (node_modules/firebase-functions-test/lib/main.js:49:26) at wrap (node_modules/firebase-functions-test/lib/main.js:32:9)
Test file code
const firebaseFunctionsTest = require("firebase-functions-test");
const {wrap} = firebaseFunctionsTest()
describe('Firestore Function Test', ()=>{
let wrappedFunction = wrap(firestoreFunction.firestoreFunction)
beforeEach(()=>{
wrappedFunction()
})
})
Function file code
exports.firestoreFunction = functions.firestore.document('/collection/doc').onCreate(
async(snap, context)=>{
//function logic
});
function functionA(){
//function A logic
}
function functionB(){
//function B logic
}
module.exports = {
functionA,
functionB
}
package.jsonto check what dependencies version are you using.module.exports.