Skip to content

Commit

Permalink
tests: fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
valerymelou committed Jul 21, 2024
1 parent 221fa1d commit 9c8994c
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions libs/shared/layout/src/test-setup.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
// @ts-expect-error https://thymikee.github.io/jest-preset-angular/docs/getting-started/test-environment
globalThis.ngJest = {
testEnvironmentOptions: {
errorOnUnknownElements: true,
errorOnUnknownProperties: true,
},
testEnvironmentOptions: {
errorOnUnknownElements: true,
errorOnUnknownProperties: true,
},
};
import 'jest-preset-angular/setup-jest';

Object.defineProperty(window, 'matchMedia', {
writable: true,
value: jest.fn().mockImplementation((query) => ({
matches: false,
media: query,
onchange: null,
addListener: jest.fn(), // Deprecated
removeListener: jest.fn(), // Deprecated
addEventListener: jest.fn(),
removeEventListener: jest.fn(),
dispatchEvent: jest.fn(),
})),
});

0 comments on commit 9c8994c

Please sign in to comment.