
Security News
pnpm 11.5 Adds Support for Recognizing npm Staged Publishes
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.
@forwardimpact/libharness
Advanced tools
Shared mocks and test fixtures so every library and service tests the same way.
Shared mocks and test fixtures so every library and service tests the same way.
import {
// Mock primitive (replaces node:test's mock.fn)
spy,
// Config / storage / logger / fs
createMockConfig,
createMockStorage,
createSilentLogger,
createMockFs,
// gRPC / RPC
createMockGrpcFn,
MockMetadata,
createMockObserverFn,
createMockTracer,
createMockAuthFn,
// Clients
createMockMemoryClient,
createMockLlmClient,
createMockAgentClient,
createMockVectorClient,
createMockGraphClient,
createMockToolClient,
// Infra
createMockSupabaseClient,
createMockS3Client,
createTurtleHelpers,
createMockProcess,
withSilentConsole,
createMockQueries,
// Agent-aligned engineering standard fixtures (pathway data)
createTestStandard,
createTestLevel,
createTestSkill,
createTestDiscipline,
createTestTrack,
createTestBehaviour,
createTestCapability,
createTestDriver,
createTestPerson,
createTestRoster,
createTestEvidenceRow,
// libeval stream/message helpers
createToolUseMsg,
createTextBlockMsg,
createTestTrace,
collectStream,
stripAnsi,
writeLines,
createMockAgentQuery,
// Assertions
assertThrowsMessage,
assertRejectsMessage,
createDeferred,
// Caching
memoizeAsync,
memoizeOnSubject,
} from "@forwardimpact/libharness";
The full export list lives in src/index.js. Subpath entries
@forwardimpact/libharness/fixture and @forwardimpact/libharness/mock remain
for narrower imports.
Before adding a helper locally in a test file, check src/index.js. If the
helper doesn't exist and would be reused across two or more files, add it to
libharness in the same PR instead of inlining. See
CONTRIBUTING.md READ-DO and DO-CONFIRM checklists for
the enforced policy and scripts/check-libharness.mjs for the pre-commit guard
that flags inline reimplementations.
spy vs node:test's mock.fnspy() matches mock.fn's shape exactly:
const fn = spy((x) => x * 2);
fn(5);
fn.mock.calls[0].arguments; // [5]
fn.mock.calls[0].result; // 10
fn.mock.callCount(); // 1
fn.mock.resetCalls();
fn.mock.mockImplementation((x) => x + 1);
Prefer spy over node:test's mock.fn — spy works under both bun test
(the default runner) and node --test.
FAQs
Shared mocks and test fixtures so every library and service tests the same way.
We found that @forwardimpact/libharness demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.

Security News
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.

Security News
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.