import 'reflect-metadata'; import { WindowRefService, } from './window-ref.service'; const initWindowRefService = ( window?: Window, ) => { return new WindowRefService(window); }; describe('nativeWindow', () => { // tslint: disable-next-line test('It returns the window object', () => { const window = {} as Window; const windowRefService = initWindowRefService( window, ); expect(windowRefService.nativeWindow) .toBe(window); }); }); describe('getUrlBeforeHash', () => { // tslint: disable-next-line test('It returns the url not including the part after the hash', () => { const window = { location: { href: 'test#posthashthings', }, } as Window; const windowRefService = initWindowRefService( window, ); expect( windowRefService.getUrlBeforeHash(), ).toBe('test'); }); });