import { html } from "./broker"; beforeAll(() => { jest.spyOn(console, "log").mockImplementation(() => {}); }); test("Generate HTML for hexagram", () => { expect(html("Hexagram No. 45 ䷬\nGathering Together [Massing]\n萃 (cuì)")) .toBe("

Hexagram No. 45 ䷬

Gathering Together [Massing] - 萃 (cuì)

"); }); test("Generate HTML for judgement", () => { expect(html("Judgement:\nGathering Together. Success.\nThe king approaches his temple.\nIt furthers one to see the great man.\nThis brings success. Perseverance furthers.\nTo bring great offerings creates good fortune.\nIt furthers one to undertake something.")) .toBe("

Judgement:

Gathering Together. Success.
The king approaches his temple.
It furthers one to see the great man.
This brings success. Perseverance furthers.
To bring great offerings creates good fortune.
It furthers one to undertake something.

"); }); test("Generate HTML for images", () => { expect(html("Images:\nOver the earth, the lake:\nThe image of Gathering Together.\nThus the superior man renews his weapons\nIn order to meet the unforseen.")) .toBe("

Images:

Over the earth, the lake:
The image of Gathering Together.
Thus the superior man renews his weapons
In order to meet the unforseen.

"); }); afterAll(() => { (console.log as jest.Mock).mockRestore(); });