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

Move from Tap to Tape for unit tests #9241

Open
mourner opened this issue Jan 28, 2020 · 1 comment
Open

Move from Tap to Tape for unit tests #9241

mourner opened this issue Jan 28, 2020 · 1 comment

Comments

@mourner
Copy link
Member

mourner commented Jan 28, 2020

Out current unit tests are powered by Tap. This is problematic for multiple reasons:

  • Tap is Node-only, which makes it hard to implement running the suite across browsers instead of just Node.
  • We're currently stuck on Tap v12.4 because later versions break our setup and I haven't been able to track down the exact root cause. There were ~70 releases since then, with the latest being v14.10.6.
  • The project philosophy generally makes it very hard to debug issues like the one above — Tap increasingly tries to cram every possible feature into it, currently having typescript, esm, remove-flow-types and nyc in its direct dependencies (while we use the last three separately and this likely leads to weird conflicts).
  • It's a bloated project with a 2700-line package lock (~100MB in node_modules).

We should switch to Tape. It's already used in our project for browser query tests, and extending its use across the project will make our test setup simpler, lighter and easier to manage. Tape advantages:

  • Works in all browsers.
  • Minimalistic. No bloat and unnecessary dependencies, easy to debug.
  • More popular — 3x the GH stars and 7x "used by" repos.
  • Much better tested. Compare this CI matrix to the Tap one.

The biggest obstacle to the switch is that a lot of our unit tests depend on beforeEach / afterEach hooks, which are not supported by Tape. The latter is a design choice, which prefers explicit setup/teardown inline in each test for simplicity and clarity. I like this approach more, but it may take substantial effort to refactor our suite to it.

cc @arindam1993 @kkaefer

@arindam1993
Copy link
Contributor

Another blocker I found while attempting this port (for the browser part of using tape) was all the node API's we use for fs and path within our tests to load fixtures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment