UNPKG

ryuu.js

Version:

Ryuu JavaScript Utility Library

16 lines (13 loc) 373 B
import { navigate } from "./navigation"; describe("navigate", () => { beforeEach(() => { window.parent.postMessage = jest.fn(); }); it("should call navigate", () => { navigate("/test", true); expect(window.parent.postMessage).toHaveBeenCalledWith( JSON.stringify({ event: "navigate", url: "/test", isNewWindow: true }), "*" ); }); });