Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { BaseMock } from './../base.mock';
import { deprecated } from 'deprecated-decorator';
const METHODS = ['subscribe', 'publish', 'unsubscribe'];
export class EventsMock extends BaseMock {
constructor() {
super('Events', METHODS);
}
@deprecated('new EventsMock()')
public static instance(): any {
return new EventsMock();
}
}
import { deprecated } from 'deprecated-decorator';
import { BaseMock } from '../base.mock';
const METHODS = ['vibrate',
];
export class VibrationMock extends BaseMock {
constructor() {
super('Vibration', METHODS);
}
@deprecated('new VibrationMock()')
static instance(): any {
return new VibrationMock();
}
}
this.spyObj.width.and.returnValue(0);
this.spyObj.doc.and.returnValue(document);
this.spyObj.win.and.returnValue(window);
this.spyObj.getActiveElement.and.returnValue(document['activeElement']);
this.spyObj.raf.and.returnValue(1);
this.spyObj.hasFocus.and.returnValue(true);
this.spyObj.getElementComputedStyle.and.returnValue({
paddingLeft: '10',
paddingTop: '10',
paddingRight: '10',
paddingBottom: '10'
});
this.spyObj.timeout.and.returnValue((callback: any, timer: number) => setTimeout(callback, timer));
}
@deprecated('new PlatformMock()')
public static instance(): any {
return new PlatformMock();
}
}