
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
babel-plugin-ava-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 example-output.md
for the transformation this plugin performs.
The example output can be generated by calling:
$ WRITE_EXAMPLES=1 ava
Contributors should not commit new examples. They will be regenerated as part of the release process.
MIT © James Talmage
FAQs
Babel plugin for protecting against improper use of `t.throws()` in AVA
The npm package babel-plugin-ava-throws-helper receives a total of 28,695 weekly downloads. As such, babel-plugin-ava-throws-helper popularity was classified as popular.
We found that babel-plugin-ava-throws-helper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.