Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix false negative with set -e #393

Merged
merged 1 commit into from
Feb 19, 2025

Conversation

elebeaup
Copy link
Contributor

@elebeaup elebeaup commented Feb 19, 2025

πŸ“š Description

Fixes: #390

πŸ”– Changes

  • Traps the exit code when running a test

πŸ–ΌοΈ Demo

Before

image

After

image

βœ… To-do list

  • I updated the CHANGELOG.md to reflect the new feature or fix

Copy link
Member

@Chemaclass Chemaclass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow amazing! Thanks πŸ₯‡

@Chemaclass Chemaclass changed the title fix: fix false negative with set -e Fix false negative with set -e Feb 19, 2025
Comment on lines +149 to +154
trap '
state::set_test_exit_code $?
runner::run_tear_down
runner::clear_mocks
state::export_subshell_context
' EXIT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very clever 🧠 πŸ‘πŸΌ

@Chemaclass Chemaclass merged commit 9fd3794 into TypedDevs:main Feb 19, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sourcing a file with set -e causes the tests to always succeed
2 participants