Currently, I have successfully pushed the contract...
# pact-js
n
Currently, I have successfully pushed the contract into our pact broker, but there was an error when I ran the test on the provider side. I cannot get the data from the provider side, it always returns '{}'. anything wrong with this setup, please help me
m
In
messageProviders
each key needs to map to the
description
in the pact file. It seems like
'configuration'
in your code should be
'a configuration'
. The
stateHandlers
also need to map to the provider states in the pact file. It seems like your provider state is also called
'a configuration'
1
if you could share the full output or pact file, I could confirm that
n
thank you, it works now
🙌 1
but what is the different between messageProviders and stateHandlers
I didn't found the doc about them on the Pact docs page
m
y
Some more general docs about provider states https://docs.pact.io/getting_started/provider_states
messageProviders
are required to map your contract interactions to the code that will produce the message. This is due to message-pact testing only the contents, and not the transport (unlike http pact)
thankyou 2