similar question, what could be the reason for get...
# pact-js
m
similar question, what could be the reason for getting these failures? and the same code is currently working on other computer? We are using the same branch but currently is throwing these errors on my end. What should I review first?
Copy code
a request for all projects
     Given Has some projects
      Request Failed - One or more of the setup state change handlers has failed

  a request for projects by employee
     Given Has some projects
      Request Failed - One or more of the setup state change handlers has failed

  a request to create a new reason
     Given is authenticated
      Request Failed - One or more of the setup state change handlers has failed
m
Copy code
One or more of the setup state change handlers has failed
that is a hint
Give
<state>
make sure the state handlers for those states are registered and working
m
but the same code is working in his local… he’s running windows, I’m running mac, but we are using the same branch with the latest 🫤
m
They might need to do some debugging. For one, start with increasing verbosity of log levels
m
regarding logs, the only way to check the output is from the terminal, right?
I’m asking because depending on the log level a lot of information will be printed in the terminal, including the big responses we are using… and the terminal is kind of cutting the information from the top
m
and the terminal is kind of cutting the information from the top
wha? What terminal are you usinsg? You should be able to make it not do that (usually scroll/buffer)
t
In that case I would pipe it to a file. I thought pact would tell you which state handler failed even on non-debug mode though. Is there an error elsewhere in the log?
a state handler failing means there’s an error in your test setup code - in the handler for setting up state
m
In that case I would pipe it to a file. I thought pact would tell you which state handler failed even on non-debug mode though. Is there an error elsewhere in the log?
yes it should be in the log output. This part is printed by the core (albeit I think the core should print out which state failed - i’ll raise a request)
m
I’m using the zsh terminal from visual studio, I’ll take a look again.
for instance, am I doing something wrong here. Warning from the output
Copy code
2023-06-23T20:20:17.460373Z  INFO ThreadId(12) pact_verifier: Running teardown provider state change handler 'Has some links' for 'a request for all links'
[14:20:17.455] WARN (89283): pact@11.0.2: no state handler found for state: "Has some links"
Copy code
describe('when a call to list all links from something', () => {
    describe('and the user is authenticated', () => {
      describe('and there are links in the database', () => {
        before(() =>
          provider.addInteraction({
            state: 'Has some links',
            uponReceiving: 'a request for all links',
m
I just checked the source code, and it should be printing errors for the states that have failed. I suspect something is awry with your logging to terminal
m
I just downloaded the code again on another computer that I got, and I'm not getting the errors there... that's odd. Probably something got corrupted
👍 1