question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

tap is a bit of a bear.

It’s slowing me down, though I’m not sure by how much.

Mostly tap is unfamiliar; though an unfamiliar test runner is a still a hurdle to contribution.

Some things it does well, like making sure a certain number of assertions are called or holding up a test until two things have each finished. Though those could be accomplished with Promise.all and an async test with an assertion on sinon.stub().

Some of the things I find odd:

  1. The requirement for t.end().
  2. That it doesn’t print a full stack trace on an exception.
  3. When things go wrong in some async code, the test just hangs. (Though maybe that would be fixed by an unhandled promise rejection handler?)
  4. Sometimes tests hang when everything seems to be fine, on account of the runner – because I’ve miscounted t.plan or not put the t.end in the right place. IIRC this is something @jlilja and @RichardLitt were running into as well.

There are a chunk of data-driven tests in the codebase (maybe mostly in test_common.js?) In other projects I’ve taken to writing tests like those using Sazerac. It makes them much easier to read and write and easy to read when they fail. Unfortunately it doesn’t support tap.

If we decided to migrate, I imagine we’d need to mix two runners for a while. That seems like a bit of a drag. Though tap is so unopinionated, I imagine there is a way to make it coexist with another runner.

I’m most familiar with Mocha, and especially like the way it handles async. Had a couple bad run-ins with Jest recently (metabolize/apollo-resolver-gcs#4), though I’m game to give it another try, especially if someone wants to champion it.

Could also wait this out – to see if Jest fixes these issues or if we get used to tap.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:32 (29 by maintainers)

github_iconTop GitHub Comments

1reaction
github-actions[bot]commented, Feb 27, 2021

🎉 This issue has been resolved in version 13.0.9 🎉

The release is available on:

Your semantic-release bot 📦🚀

1reaction
mastermattcommented, Feb 29, 2020

I opened a PR for assertions on destroy and dynamic response bodies: https://github.com/nock/nock/pull/1938 And I’m starting on the delay tests next.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TestRunner | ReadyAPI Documentation - SmartBear Support
The test runner allows you to run functional tests and export results. You can start the runner from the command line or from...
Read more >
Web Test Runner
Test runner for web applications. Headless browsers with Puppeteer, Playwright, Selenium or WebdriverIO. Reports logs, 404s, and errors from the ...
Read more >
What is the difference between a test runner, testing framwork ...
Test Runners work on the highest level of abstraction out of all testing software. All the other testing software takes place within the...
Read more >
Open Source JavaScript Test Runner | cypress.io testing tools
Fast, easy and reliable testing for anything that runs in a browser. Install Cypress in seconds and take the pain out of front-end...
Read more >
Test runner | Node.js v19.3.0 Documentation
The node:test module facilitates the creation of JavaScript tests that report results in TAP format. To access it: import test from 'node:test'; ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found