Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function createFixture() {
const ctx = TestContext.createHTMLTestContext();
const { lifecycle, scheduler, dom } = ctx;
// const originalWnd = ctx.wnd;
// const mockWnd = new MockWindow(originalWnd, originalWnd.history, originalWnd.location);
// const addEventListener = createSpy(mockWnd, 'addEventListener');
// const removeEventListener = createSpy(mockWnd, 'removeEventListener');
// (DOM as Writable).window = mockWnd;
const sut = new BrowserNavigator(scheduler, dom);
const mockBrowserHistoryLocation = new MockBrowserHistoryLocation();
mockBrowserHistoryLocation.changeCallback = sut.handlePopstate;
sut.history = mockBrowserHistoryLocation as any;
sut.location = mockBrowserHistoryLocation as any;
function tearDown() {
// (DOM as Writable).window = originalWnd;
}
callbackCount = 0;
const callback = ((info) => {
callbackCount++;
});
return { sut, tearDown, callback, lifecycle };
}