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

tests: use parameterised testing using jest.each for extensions.test.ts #514

Conversation

aneeshrelan
Copy link
Contributor


name: ⚙ Improvement
about: Refactoring tests to reduce redundancies using jest.each
labels: enhancement


A Pull Request should be associated with a Discussion.

Refactoring the tests to be using parameters with jest.each

Related discussion: #506

Further notes in Contribution Guidelines
Thank you for your contribution.

Description

This PR improves the test code by refactoring existing unit tests using parameterised testing by jest.each

In case this PR introduced TypeScript/JavaScript code changes:

  • I have written test cases for the changes in this pull request
  • I have run npm run format before the commit.
  • I have run npm run lint before the commit.
  • I have run npm run release before the commit.
  • npm test returns with no unit test errors and all code covered.

In case this PR edits any scripts:

  • I have checked the edited scripts for syntax.
  • I have tested the changes in an integration test (If yes, provide workflow YAML and link). - NA

__tests__/extensions.test.ts Outdated Show resolved Hide resolved
__tests__/extensions.test.ts Outdated Show resolved Hide resolved
__tests__/extensions.test.ts Show resolved Hide resolved
__tests__/extensions.test.ts Show resolved Hide resolved
__tests__/extensions.test.ts Show resolved Hide resolved
__tests__/extensions.test.ts Outdated Show resolved Hide resolved
__tests__/extensions.test.ts Outdated Show resolved Hide resolved
@shivammathur
Copy link
Owner

@aneeshrelan This looks very good, there are some minor changes in the review above, also it would be great if you can sort the test case data.

@shivammathur shivammathur linked an issue Oct 8, 2021 that may be closed by this pull request
@aneeshrelan aneeshrelan changed the title tests: use parameterised testing using jest.each tests: use parameterised testing using jest.each for extensions.test.ts Oct 8, 2021
@aneeshrelan aneeshrelan marked this pull request as ready for review October 8, 2021 16:56
@aneeshrelan
Copy link
Contributor Author

aneeshrelan commented Oct 8, 2021

@shivammathur Resolved all feedback please check. Made this ready for review and only targeting extensions.test.ts. Will raise separate ones for other tests

@shivammathur shivammathur merged commit 8dfe214 into shivammathur:develop Oct 8, 2021
@shivammathur
Copy link
Owner

Merged 🎉

@shivammathur shivammathur added awaiting-release Added/Fixed and tested, awaiting release hacktoberfest-accepted labels Oct 8, 2021
@aneeshrelan aneeshrelan deleted the feature/refactor-tests-to-use-jest-each branch October 24, 2021 13:14
@shivammathur shivammathur removed the awaiting-release Added/Fixed and tested, awaiting release label Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor: Use parameterised testing using jest.it.each
2 participants