Hi, what could be the cause of this error ``` ...
# pact-js
m
Hi, what could be the cause of this error
Copy code
Error: PactffiResponseStatus(arg 1) expected a number
      at withStatus (node_modules/@pact-foundation/pact-core/src/consumer/index.js:108:45)
      at Object.withStatus (node_modules/@pact-foundation/pact-core/src/consumer/checkErrors.js:9:20)
      at setResponseDetails (node_modules/@pact-foundation/pact/src/httpPact/ffi.js:106:17)
      at Pact.addInteraction (node_modules/@pact-foundation/pact/src/httpPact/index.js:196:38)
      at Context.<anonymous> (test/consumer.spec.js:426:20)
      at processImmediate (node:internal/timers:466:21)
line 426 looks like this
Copy code
provider.addInteraction({
m
Can you please show the test? Looks like there is a missing type validation error that should appear higher up the stack. My guess is you are providing a non number to the field that specifies the response status code
m
thanks, I've identify the issue... it was a problem on the
Copy code
willRespondWith...
m
Can you please share? It sounds like a bug still and I'd like to address it.
Or for my adoration, a GH issue would be 💪
m
let me share the issue, and you tell me if that's a bug or my bad haha
instead of passing all of these things in the willRespondWith
Copy code
status: 200,
    headers: {      
      'Content-Type': 'application/json; charset=utf-8',
    },
    body: successBodyJsonFile,
I was passing only the content of the successBodyJsonFile So, I was missing the headers, status, etc....
m
Yes, it's still a bug I think. It should error more clearly
Tha ks for sharing
m
I'll create the GH issue, do you have handy the GH link?
m