18 lines
539 B
TypeScript
18 lines
539 B
TypeScript
// Required so Angular's `HttpRequest`/`HttpResponse` (used in unit
|
|
// tests of HttpInterceptorFn logic) can be instantiated in tests without
|
|
// pre-compiled metadata.
|
|
import '@angular/compiler';
|
|
|
|
Object.defineProperty(window, 'matchMedia', {
|
|
writable: true,
|
|
value: jest.fn().mockImplementation((query) => ({
|
|
matches: false,
|
|
media: query,
|
|
onchange: null,
|
|
addListener: jest.fn(),
|
|
removeListener: jest.fn(),
|
|
addEventListener: jest.fn(),
|
|
removeEventListener: jest.fn(),
|
|
dispatchEvent: jest.fn(),
|
|
})),
|
|
}); |