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

add setUp, setUpBeforeScript, tearDown and tearDownAfterScript functions execution #92

Merged
merged 3 commits into from
Sep 15, 2023

Conversation

cmayo
Copy link
Collaborator

@cmayo cmayo commented Sep 15, 2023

📚 Description

You can create functions with the following names in your test script to perform actions before and after test/script:

setUp

If this function exists in the test script it will be executed before each test execution.

setUpBeforeScript

If this function exists in the test script it will be executed only one time before all tests execution.

tearDown

If this function exists in the test script it will be executed after each test execution.

tearDownAfterScript

If this function exists in the test script it will be executed only one time after all tests execution.

✅ To-do list

  • Make sure that all the pipeline passes
  • Make sure to update 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.

Thank you! 🤩 This will close #47

@Chemaclass Chemaclass added the enhancement New feature or request label Sep 15, 2023
@Chemaclass
Copy link
Member

Can you please add these new functions to the CHANGELOG.md, @cmayo?

Copy link
Collaborator

@fabriziofs fabriziofs left a comment

Choose a reason for hiding this comment

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

Great work ✨

function test_no_function_is_executed_with_execute_function_if_exists() {
local function_name='notExistingFunction'

assertEmpty "$(executeFunctionIfExists "$function_name")"
Copy link
Member

@khru khru Sep 15, 2023

Choose a reason for hiding this comment

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

This function does not exist assertEmpty may be you mean assertNotEquals

Copy link
Collaborator Author

@cmayo cmayo Sep 15, 2023

Choose a reason for hiding this comment

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

Yes, you are right. I'm trying to check why I didn't get any error with this non-existent method

Copy link
Member

Choose a reason for hiding this comment

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

No, thanks to you, We've just added the assert #93 (it needs a refactor, but the first step is there)

@khru khru merged commit 8c7e0bd into TypedDevs:main Sep 15, 2023
7 checks passed
@Chemaclass Chemaclass mentioned this pull request Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants