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(testing): stop code execution in describe.ignore #6237

Merged
merged 1 commit into from
Dec 6, 2024

Conversation

IgorM867
Copy link
Contributor

@IgorM867 IgorM867 commented Dec 5, 2024

In the current implementation, code inside a describe block is executed in every case, even when describe.ignore or describe.skip is used. This behavior is reflected in the following example and is currently tested as expected behavior:

Code:

describe.ignore("should ignore", () => {
  assert(false);
});

Error:

Uncaught error from ./main.ts FAILED

 ERRORS 

./main.ts (uncaught error)
error: (in promise) AssertionError
    throw new AssertionError(msg);
          ^

This happens because the describe block is treated as a list of steps rather than as a single step itself. In my implementation, all code inside a describe.ignore block is ignored.

Fixes #6233

@IgorM867 IgorM867 requested a review from kt3k as a code owner December 5, 2024 07:22
Copy link

codecov bot commented Dec 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.52%. Comparing base (ed06cbd) to head (39c72cd).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6237      +/-   ##
==========================================
- Coverage   96.52%   96.52%   -0.01%     
==========================================
  Files         534      534              
  Lines       40976    41008      +32     
  Branches     6134     6141       +7     
==========================================
+ Hits        39553    39581      +28     
- Misses       1381     1385       +4     
  Partials       42       42              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

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

Confirmed the case in #6233 is fixed by this change. Thanks!

@kt3k kt3k merged commit f13db89 into denoland:main Dec 6, 2024
18 checks passed
@dandv
Copy link
Contributor

dandv commented Dec 6, 2024

@IgorM867: thanks for the quick fix! thoughts on the Jest and docs issues I mentioned in the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

describe.skip does not skip assertions in block
3 participants