open-nav
    Preparing search index...

    Function startMockServer

    • Start a local stand-in for the Online Számla invoice service.

      It speaks the real XML on the real paths, verifies the request signature the way NAV does, and decides an invoice's fate by running it through this project's validator. That last part is what makes it useful: a test that submits a broken invoice sees a realistic ABORTED result with the fault code NAV would have reported.

      const mock = await startMockServer({ credentials });
      const client = new NavClient({ credentials, software, baseUrl: mock.url });

      Parameters

      Returns Promise<MockServer>