-
-
Notifications
You must be signed in to change notification settings - Fork 747
Closed
@h2oJan
Description
What are you trying to achieve?
When an error is thrown inside an After
or AfterSuite
hook in CodeceptJS, the process should exit with a non-zero exit code (e.g. 1
), indicating failure.
What do you get instead?
Process exits with code 0
, indicating success. This misleads CI systems and users, as the test run should be considered failed when any lifecycle hook fails.
This worked correctly in CodeceptJS 3.6.6.
It also works correctly for Before
and BeforeSuite
hooks.
Reproduction steps
Feature('after-hook');
Before(({ I }) => {
I.amOnPage('https://www.google.com')
I.waitForText('Google')
})
After(({ I }) => {
I.waitForText('Google-xxx-FAIL') // This will fail
})
Scenario('test something', ({ I }) => {
I.waitForText('Google')
})
To obtain exit code, you can run with npm run codeceptjs; echo "Exit code: $?"
Details
- CodeceptJS version: 3.7.3
- Working CodeceptJS version: 3.6.6
- Helper: Playwright
- NodeJS version: 24.3.0
- Operating System: MacOS
Metadata
Metadata
Assignees
Labels
No labels