Skip to content

Test running overhaul, switch to Prettier & reformat everything #1407

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

Merged
merged 12 commits into from
Oct 3, 2023
Merged

Test running overhaul, switch to Prettier & reformat everything #1407

merged 12 commits into from
Oct 3, 2023

Conversation

defaude
Copy link
Contributor

@defaude defaude commented Oct 2, 2023

This PR overhauls the test setup as well as the pipeline

Fixes #1378

Node 20 is now the default minimum engine

This doesn't mean stuff will break if people are using older versions of Node, but they will get a warning during npm install. Vitest should be fine with Node >= 14.18, actually. Nevertheless, it's a reasonable thing to assume everyone has at least the current "active LTS" version of Node available.

Replacing Jest + Babel with Vitest

We already switched to ESM a while ago. There is no need to pump everything through Babel into Jest. Vitest is a blazing-fast drop-in replacement that is mostly Jest-compatible (and definitely better compatible with Jest than Bun is...). This change allows us to drop a ton of npm dependencies.

Remove standard in favor of prettier

There was a .prettierrc file in the repo already, but for some reason we were stuck with standard. I took the liberty to clean up here, as well. It's now prettier only all the way. This means I had to automatically reformat the code once.

Update pipeline

First of all: The long-running test we observed in #1193 is now working just fine when it's running in Vitest on Node 20 🤷

This allows us to run all tests in the pipeline again (and we definitely should). We should also aim for

  • only ever merge any PRs when their pipeline is green
  • only ever commit & push when the tests are successful (this should be ensured by the pre-commit hook, but I get the feeling that many people are simply suppressing them?)

appgurueu
appgurueu previously approved these changes Oct 2, 2023
Copy link
Collaborator

@appgurueu appgurueu left a comment

Choose a reason for hiding this comment

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

Looks good to me, though I'd prefer keeping line endings at LF in the prettier config unless there is a good reason against it. I also wonder how our CI apparently passed with failing tests (but analyzing or fixing that can be done later, it doesn't have to be in this PR).

Note to self & Rak: Look at the commits individually to not get caught up in the large formatting diff, don't squash.

@appgurueu appgurueu changed the title Test running overhaul Test running overhaul, switch to Prettier & reformat everything Oct 2, 2023
appgurueu
appgurueu previously approved these changes Oct 2, 2023
@raklaptudirm raklaptudirm merged commit 86d333e into TheAlgorithms:master Oct 3, 2023
@defaude defaude deleted the chore/switch-to-vitest branch October 4, 2023 15:29
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.

[FEATURE]: Switch to Bun or Vitest for running tests
3 participants