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

Replace mocha with Node's test suit #391

Merged
merged 7 commits into from
Dec 19, 2024
Merged

Replace mocha with Node's test suit #391

merged 7 commits into from
Dec 19, 2024

Conversation

Secreto31126
Copy link
Owner

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time.
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with npm run test and lint the project with npm run lint and npm run prettier

Mocha has a weird support for ESM. If we want to drop CJS support, the tests also need to be ESM.

The PR replaces Mocha with the native NodeJS test suit, which although "experimental", it works really nice.

Now we can test esm code safely. Plus, the native tests detect way more bugs than mocha, such as missing awaits and similars, so really happy with the change :]
Copy link

github-actions bot commented Dec 19, 2024

Visit the preview URL for this PR (updated for commit 05f639a):

https://whatsappapijs--pr391-drop-mocha-hrvyn86k.web.app

(expires Thu, 26 Dec 2024 23:33:28 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 80a8dc4ceea5c783aae1d47b75797ee5b6c2f4be

@Secreto31126
Copy link
Owner Author

What if we also drop Node 18? I mean, Undici already did, so...

@Secreto31126 Secreto31126 changed the title Drop mocha Replace mocha with Node's test suit Dec 19, 2024
@Secreto31126
Copy link
Owner Author

Seems like Node 18 will last a few more months

@Secreto31126 Secreto31126 merged commit 19c23be into main Dec 19, 2024
8 checks passed
@Secreto31126 Secreto31126 deleted the drop-mocha branch December 19, 2024 23:36
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.

1 participant