Websites v4 docs v5.2.5
    Preparing search index...

    Function createHFServer

    • Creates a custom test server to reduce boilerplate in test files when mocking Homeflow api requests.

      Most models will use the Agency model in some way, often to access the current agency's id. Any usage of the Agency will require mocking the hestia /sites request, as well as potentially mocking the dbapi /sites request, which in turn requires mocking the app authentication request via users api.

      Adding each of these mocks to every test file is repetive and bloats the tests with additional imports. createHFServer mocks the default requests required by most models and allows passing in of model specific mocked requests, reducing boilerplate code.

      Parameters

      • additionalMocks: any[] = []

      Returns SetupServer