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

Modernize tests #207

Merged
merged 20 commits into from
Mar 12, 2024
Merged

Modernize tests #207

merged 20 commits into from
Mar 12, 2024

Conversation

ggalmazor
Copy link
Contributor

@ggalmazor ggalmazor commented Mar 8, 2024

In this PR:

  • Migrate our test suite to Jest and removes dependencies on Mocha, Chai, and Sinon.
  • Migrate async tests to the recommended async/await style by Jest
  • Minor tweaks and simplifications on the tests code

Most of the adaptations have been made with jest-codemods following the instructions in the https://jestjs.io/docs/migration-guide. I just had to tweak a couple of tests manually.

@ggalmazor ggalmazor self-assigned this Mar 8, 2024
@ggalmazor
Copy link
Contributor Author

@DXTimer, could you please help me debug this failing test? I can't figure out why it's failing while all the others in the same file and using the same fixtures and code structure pass...

image

- Nock acts in the global scope and mocks from `describe` blocks were interfering outside their scope
- Simplify fixture reading by returning the reply fn nock requires
- Actually assert nock expectations
@ggalmazor
Copy link
Contributor Author

Nevermind, @DXTimer :) I figured it out :)

- Nock acts in the global scope and mocks from `describe` blocks were interfering outside their scope
- Simplify fixture reading by returning the reply fn nock requires
- Actually assert nock expectations
- Nock acts in the global scope and mocks from `describe` blocks were interfering outside their scope
- Simplify fixture reading by returning the reply fn nock requires
- Actually assert nock expectations
- Nock acts in the global scope and mocks from `describe` blocks were interfering outside their scope
- Simplify fixture reading by returning the reply fn nock requires
- Actually assert nock expectations
- Use `function` for better semantics
- Extract smaller functions to provide better semantics at the cost of iterating the fixture lines twice
@ggalmazor ggalmazor merged commit 1be7dd2 into main Mar 12, 2024
5 checks passed
@ggalmazor ggalmazor deleted the change/modernize_tests branch March 12, 2024 08:07
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.

None yet

2 participants