When using @xstate/test@alpha with Playwright, if assertion errors are thrown, additional information from @xstate/test won't be logged by Playwright (the state in which the assertion failed, the events sent before the error occurred, etc.).
I would expect information about visited states and sent events to be shown on the logs.
As noted in Node.js documentation (https://nodejs.org/api/errors.html#errormessage):
changing [error.message] after the Error object is created may not change the first line of the stack trace (for example, when error.stack is read before this property is changed)
It seems that Playwright reads error.stack
before @xstate/test overrides error.message
, which does not update error.stack
.
npm install
npx playwright test