bit
bit copied to clipboard
"ReferenceError: FontFace is not defined" during test runs
Describe the bug
Running bit test throws a ReferenceError: FontFace is not defined error when testing a component that uses the CSS Font Loading API.
Steps to Reproduce
- run bit test on a component that uses the font loading API
Expected Behavior
Successful run of the unit tests
Screenshots, exceptions and logs
` ReferenceError: FontFace is not defined
1 | export const loadBebasNeueFont = () => {
> 2 | var bebasNeue = new FontFace("Bebas Neue", "url(https://fonts.gstatic.com/s/bebasneue/v8/JTUSjIg69CK48gW7PXoo9Wlhyw.woff2)", {weight: "400"});
| ^
3 |
4 | bebasNeue
5 | .load()`### Specifications* Bit version: 0.0.603
- Workspace type: harmony
- Node version: 14.17.3
- npm / yarn version: 6.14.13
- Platform: windows 10
"teambit.dependencies/dependency-resolver": {
/**
* choose the package manager for Bit to use. you can choose between 'yarn', 'pnpm'
*/
"packageManager": "teambit.dependencies/pnpm",
"policy": {
"dependencies": {
"@testing-library/dom": "8.11.3",
"@testing-library/react": "12.1.3",
"@testing-library/user-event": "13.5.0",
Forgot to mention that the Font Loading API works perfectly fine outside of the tests, I am able to tag and export components that use it just fine, but when put in the tests it throws those errors.
resolved in new envs api