
Research
Node.js Fixes AsyncLocalStorage Crash Bug That Could Take Down Production Servers
Node.js patched a crash bug where AsyncLocalStorage could cause stack overflows to bypass error handlers and terminate production servers.
@tapjs/nock
Advanced tools
@tapjs/nockA tap extension that integrates nock.
t.nock()
nock.disableNetConnect()nock, and the result from
nock returnednock.enableNetConnect() in teardownt.nock.snapshot()
nock scopes for youLoad the @tapjs/nock plugin in your tap config.
For example, in .taprc:
plugins:
- @tapjs/nock
Or in package.json:
{
"tap": {
"plugins": ["@tapjs/nock"]
}
}
Then use it in your tests like so:
import t from 'tap'
t.test('sends a request', async t => {
t.nock('https://registry.npmjs.org')
.get('/')
.reply(200, { hello: 'world' })
const res = await fetch('https://registry.npmjs.org')
t.equal(res.status, 200)
const body = await res.json()
t.same(body, { hello: 'world' })
})
// when snapshots are enabled, this test will send a real request
// and record the response
// when they are disabled, the recorded response will be
// automatically loaded into a nock scope, and the test will
// receive that response
// This requires that the @tapjs/snapshot plugin is enabled.
t.test('snapshots a request', async t => {
t.nock.snapshot()
const res = await fetch('https://registry.npmjs.org')
t.equal(res.status, 200)
const body = await res.json()
t.match(body, { db_name: 'registry' })
})
You may use it directly, though that is a bit more clunky,
because it won't be automatically applied to child tests, but it
can be good if you only need nock in a small number of tests.
import { plugin as tapNock } from '@tapjs/nock'
import t from 'tap'
t.test('sends a request', async t => {
const tn = tapNock(t)
tn.nock('https://registry.npmjs.org')
.get('/')
.reply(200, { hello: 'world' })
const res = await fetch('https://registry.npmjs.org')
t.equal(res.status, 200)
const body = await res.json()
t.same(body, { hello: 'world' })
})
// when snapshots are enabled, this test will send a real request
// and record the response
// when they are disabled, the recorded response will be
// automatically loaded into a nock scope, and the test will
// receive that response
// This requires that the @tapjs/snapshot plugin is enabled.
t.test('snapshots a request', async t => {
const tn = tapNock(t)
tn.nock.snapshot()
const res = await fetch('https://registry.npmjs.org')
t.equal(res.status, 200)
const body = await res.json()
t.match(body, { db_name: 'registry' })
})
This plugin was originally developed by nlf as the standalone extension @npmcli/tap-nock, and the use case was a major inspiration for tap's plugin eventual architecture.
FAQs
a nock extension for tap
The npm package @tapjs/nock receives a total of 54 weekly downloads. As such, @tapjs/nock popularity was classified as not popular.
We found that @tapjs/nock demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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
Node.js patched a crash bug where AsyncLocalStorage could cause stack overflows to bypass error handlers and terminate production servers.

Research
/Security News
A malicious Chrome extension steals newly created MEXC API keys, exfiltrates them to Telegram, and enables full account takeover with trading and withdrawal rights.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.