Karma proxy setup with Angular + Pact-JS

What I learned today — 6 April 2018

Niel de Wet
1 min readApr 6, 2018

As part of configuring consumer pact tests in an Angular project one has to set up a Karma proxy. While working on the test I expected to see requests to the proxy in the browser’s network tab, but instead I only saw 404’s to the Karma server. It turned out that proxying to the Pact mock server was actually working, but the problem was with the request path: The request path configured in the provider interaction has to match the client’s request exactly, and should include the leading forward-slash. For example: path: '/auth/login

--

--

Responses (1)