forked from ngx-formly/ngx-formly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjestSetup.ts
33 lines (28 loc) · 802 Bytes
/
jestSetup.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import 'jest-preset-angular/setup-jest';
import 'jest-extended';
// https://github.com/thymikee/jest-preset-angular/issues/347
import '@angular/localize/init';
// https://github.com/jsdom/jsdom/issues/1695#issuecomment-449931788
Element.prototype.scrollIntoView = jest.fn();
Object.defineProperty(window, 'CSS', { value: null });
Object.defineProperty(window, 'getComputedStyle', {
value: () => {
return {
display: 'none',
appearance: ['-webkit-appearance'],
getPropertyValue: () => '',
};
},
});
Object.defineProperty(document, 'doctype', {
value: '<!DOCTYPE html>',
});
Object.defineProperty(document.body.style, 'transform', {
value: () => {
return {
enumerable: true,
configurable: true,
};
},
});
Element.prototype.scrollTo = () => {};