GitHub
03/06/2023, 3:22 PMafterEach hook, such as a database clean-up activity, then the function should complete execution before the test runner terminates.
Actual behaviour
Test runner terminates before the function completes execution.
Steps to reproduce
1. Clone down the reproducing repository - https://github.com/james-kuihi/pact-js-aftreEach-bug-demo
2. Run the tests which reproduce the issue:
cd examples/v3/afterEach-bug
npm install
npm test
You should see log output including:
Starting afterEach
...
Finished afterEach
However, only the first line is present. The pertinent provider test which reproduces this is here.
Relevant log files
test.log
Other
This was raised and discussed on the PactJS Slack channel, and a improvement idea for the core framework raised in Canny.
pact-foundation/pact-js