ianstormtaylor / superstruct

A simple and composable way to validate data in JavaScript (and TypeScript).
https://docs.superstructjs.org
MIT License
6.95k stars 224 forks source link

Move tests to Vitest #1226

Closed arturmuller closed 2 months ago

arturmuller commented 5 months ago

Superstruct tests are currently written in Mocha, which is starting to show its age. It would be great if we could move to something like Vitest. This has two goals:

  1. Unblock #1224 (Mocha is currently failing because it is not compatible with the new config)
  2. Make the lib more comfortable to contribute/work with for new contributors — I doubt there are many people who would choose Mocha over Vitest in 2024.

@ciscoheat — I saw that you already got started on this in #1211 , but when I try to run it locally it didn't actually run most of the tests. If you were willing to look into this again, with the sole focus being moving to Vitest, it would be massively appreciated. 🙌

So that goal is:

  1. Making sure that all tests run
  2. (stretch goal) Refactoring the tests so that they seem familiar to a person who has only ever worked with Vitest. (The current implementation is not how I would expect anyone to write Vitest tests).