'INTERNAL ASSERTION FAILED: Expected a class definition - Jest jsdom firebase emulator testing
Hi I'm trying to get client side firebase auth with emulator testing to work in jest using Angular. I need to use firebase in a jsdom environment since I want to use firebase-admin together in my spec files to do any test/emulator cleanup work. This line causes the following error:
import firebase from 'firebase/compat'
firebase.client.auth() <--- `INTERNAL ASSERTION FAILED: Expected a class definition`
Anyone know how to get around this issue?
Config for reference:
module.exports = {
displayName: 'jest-test',
preset: '../../../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.e2e.spec.json',
},
},
transform: {
'^.+\\.[tj]s$': 'ts-jest',
},
setupFilesAfterEnv: ['<rootDir>/../jest.setup.ts'],
moduleFileExtensions: ['ts', 'js', 'html'],
coverageDirectory: '../../../../coverage/somewhere',
testEnvironment: 'jsdom', <---
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
