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): add missing methods to test alias of it #6222

Merged
merged 6 commits into from
Dec 2, 2024

Conversation

IgorM867
Copy link
Contributor

@IgorM867 IgorM867 commented Dec 1, 2024

test is documented as an alias for it, but it does not currently implement methods like only, ignore, and skip. This PR fixes the issue by ensuring test correctly mirrors the behavior and methods of it.

Fixes #6220

@IgorM867 IgorM867 requested a review from kt3k as a code owner December 1, 2024 13:53
Copy link

codecov bot commented Dec 1, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 96.52%. Comparing base (c88c773) to head (6a0eb25).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
testing/bdd.ts 80.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6222      +/-   ##
==========================================
- Coverage   96.53%   96.52%   -0.02%     
==========================================
  Files         534      534              
  Lines       40952    40967      +15     
  Branches     6133     6133              
==========================================
+ Hits        39535    39542       +7     
- Misses       1375     1382       +7     
- Partials       42       43       +1     

☔ 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.

Mostly looks good to me. Thanks for working on this. Left a few questions.

testing/bdd.ts Outdated
Comment on lines 766 to 770
const options = itDefinition(...args);
return it({
...options,
only: true,
});
Copy link
Member

Choose a reason for hiding this comment

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

Can we use it.only?

Suggested change
const options = itDefinition(...args);
return it({
...options,
only: true,
});
it.only(...args);

testing/bdd.ts Outdated
Comment on lines 795 to 799
const options = itDefinition(...args);
return it({
...options,
ignore: true,
});
Copy link
Member

Choose a reason for hiding this comment

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

Can we use it.ignore?

Suggested change
const options = itDefinition(...args);
return it({
...options,
ignore: true,
});
it.ignore(...args);

@IgorM867
Copy link
Contributor Author

IgorM867 commented Dec 2, 2024

You’re right. I made the requested changes, and I also added some tests. However, I’m not completely confident about these tests because I copied an existing it test, which led to a lot of duplicate code. Let me know what you think.

@kt3k
Copy link
Member

kt3k commented Dec 2, 2024

I don't think we need new test cases for these as they only have single line implementations, and no new logics are introduced.

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.

LGTM

@kt3k kt3k merged commit 3d224fd into denoland:main Dec 2, 2024
18 checks passed
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.

test is not exactly an alias for it
2 participants