firebase / firebase-functions-test

MIT License
231 stars 48 forks source link

Running tests imports main from package and fails to exec #219

Open RohovDmytro opened 5 months ago

RohovDmytro commented 5 months ago

Running test via jest executes main file from package.json. It's a react-native code in my setup and this messes things around.

image
RohovDmytro commented 5 months ago

Workaround is to mock @app/index via jest.setup.js

const { jest } = require('@jest/globals');

jest.mock('@app/index.js', () => ({}));
RohovDmytro commented 5 months ago

Note to mock before requiring firebase-functions-test