frontity
Version:
Frontity cli and entry point to other packages
23 lines (18 loc) • 687 B
text/typescript
import serve from "../serve";
import * as core from "@frontity/core";
import * as choosePort from "../../utils/choosePort";
jest.mock("@frontity/core");
jest.mock("../../utils/choosePort");
const mockedCore = core as jest.Mocked<typeof core>;
const mockedChoosePort = choosePort as jest.Mocked<typeof choosePort>;
describe("serve", () => {
beforeEach(() => {
mockedCore.serve.mockReset();
mockedChoosePort.default.mockReset();
mockedChoosePort.default.mockImplementation(() => 3000);
});
test("gets the correct default values when it receives an empty object", async () => {
await serve({});
expect(mockedCore.serve.mock.calls).toMatchSnapshot();
});
});