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 warning and failing test decorators #5929

Merged
merged 28 commits into from May 9, 2024
Merged

Add warning and failing test decorators #5929

merged 28 commits into from May 9, 2024

Conversation

Latropos
Copy link
Contributor

@Latropos Latropos commented Apr 23, 2024

Summary

After this PR we are going to support the following API:

Describe:

  • describe("Name of the test suite", ()=>{})
  • describe.skip("Name of the test suite", ()=>{})
    • Skip test suite
  • describe.only("Name of the test suite", ()=>{})
    • Run only test cases and test suite(s) with only decorator

Test:

  • default
    • test("Name of the test suite", ()=>{})
    • test.each([1,2,3])("Name of the test suite", ()=>{})
  • skip ⏭️ - skip test case(s)
    • test.skip("Name of the test suite", ()=>{})
    • test.skip.each([1,2,3])("Name of the test suite", ()=>{})
  • only - run only test case(s) and suite(s) with only decorator
    • test.only("Name of the test suite", ()=>{})
    • test.only.each([1,2,3])("Name of the test suite", ()=>{})
  • warn ⚠️ - expect console.warn to be called
    • test.warn("Name of the test suite", "Expected error message", ()=>{})
    • test.warn.each([1,2,3])("Name of the test suite", "Expected error message", ()=>{})
  • failing - expect error to be thrown
    • test.failing("Name of the test suite", "Expected error message", ()=>{})
    • test.failing.each([1,2,3])("Name of the test suite", "Expected error message", ()=>{})

Test plan

@Latropos Latropos changed the base branch from main to acynk/skip_and_only April 23, 2024 10:05
@Latropos Latropos marked this pull request as ready for review April 29, 2024 15:04
Base automatically changed from acynk/skip_and_only to main April 30, 2024 10:34
@Latropos Latropos marked this pull request as draft May 6, 2024 11:48
@Latropos Latropos marked this pull request as ready for review May 6, 2024 13:32
@Latropos Latropos requested a review from piaskowyk May 6, 2024 13:32
@tomekzaw tomekzaw changed the title Ad warning and failing test decorators Add warning and failing test decorators May 8, 2024
@Latropos Latropos requested review from tjzel and szydlovsky May 8, 2024 10:21
Copy link
Contributor

@szydlovsky szydlovsky left a comment

Choose a reason for hiding this comment

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

Looks good, left just one small comment 😄

@Latropos Latropos added this pull request to the merge queue May 9, 2024
Merged via the queue into main with commit 8a792b6 May 9, 2024
7 checks passed
@Latropos Latropos deleted the acynk/failing branch May 9, 2024 09:55
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.

None yet

2 participants