
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@ava/babel-plugin-throws-helper
Advanced tools
Babel plugin for protecting against improper use of `t.throws()` in AVA
Babel plugin for protecting against improper use of
t.throws()in AVA
Probably not useful except as an internal plugin for the AVA test runner.
I've seen a lot of incorrect use of the throws assertion in other test runner and even done the mistake myself sometimes. Now I'm beginning to see it with AVA too, so would be nice to be preemptive about it.
People don't realize they need to wrap their call in a function, so many end up doing
t.throws(foo())instead oft.throws(() => foo());. It's an easy mistake to make.
The difficulty is that t.throws(foo()) is allowed if foo() returns a promise or a function. There is no good way to differentiate between the two at runtime. So providing a good error message is going to take some AST transform magic.
See test.js.md for the transformation this plugin performs.
MIT © James Talmage
FAQs
Babel plugin for protecting against improper use of `t.throws()` in AVA
The npm package @ava/babel-plugin-throws-helper receives a total of 72,818 weekly downloads. As such, @ava/babel-plugin-throws-helper popularity was classified as popular.
We found that @ava/babel-plugin-throws-helper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.