
Security News
Ruby's Bundler 4.0.18 Extends Cooldown to bundle lock and bundle cache
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.
@buzzr/dfs-testkit
Advanced tools
Fixture builders and mock providers for @buzzr/dfs-engine consumers.
Fixture builders and mock stat providers for testing @buzzr/dfs-engine integrations. Build a valid v4-canonical DFS entry in one line, override only what your test cares about, and wire a deterministic stat provider without touching the network.
npm install --save-dev @buzzr/dfs-testkit @buzzr/dfs-engine
Works with Vitest, Jest, or any test runner:
import { test, expect } from 'vitest';
import { createDfsEngine } from '@buzzr/dfs-engine';
import {
makeDfsEntry,
makeDfsLeg,
makeGameLogEntry,
createMockStatProvider,
} from '@buzzr/dfs-testkit';
test('a PrizePicks Power entry settles as won when both legs hit', async () => {
const entry = makeDfsEntry({
legs: [
makeDfsLeg({ legId: 'leg-1', propType: 'Points', line: 20.5 }),
makeDfsLeg({ legId: 'leg-2', propType: 'Rebounds', line: 6.5 }),
],
});
const provider = createMockStatProvider({
'leg-1': [makeGameLogEntry({ points: '24' })],
'leg-2': [makeGameLogEntry({ rebounds: '9' })],
});
const engine = createDfsEngine({ statProviders: [provider] });
const result = await engine.settleEntry(entry, { statProviderId: provider.id });
expect(result.status).toBe('won');
});
Every builder returns a complete, engine-valid object with sensible defaults (prizepicks / power / NBA points over), so tests only spell out what they assert.
| Export | Purpose |
|---|---|
makeDfsEntry() | A valid DfsEntryInput (PrizePicks Power, one leg) with overridable fields |
makeDfsLeg() | A valid DfsLegInput (NBA Points over 20.5) with overridable fields |
makeGameLogEntry() | A valid PlayerGameLogEntryShape boxscore row with overridable stats |
createMockStatProvider() | A deterministic StatProvider serving rows from a legId → rows map |
makeInvalidDfsEntry() | An entry with duplicate leg ids and zero stake, for validation-path tests |
Fixtures emit v4-canonical shapes (actual, status, per-leg legId keys), so anything you build here passes the engine's boundary validators — except makeInvalidDfsEntry, which is designed to fail them.
| You want to… | Reach for |
|---|---|
| Write unit tests for your own settlement integration | this package |
| Replay versioned engine regression fixtures | @buzzr/dfs-engine-test-vectors |
| Grade entries in production code | @buzzr/dfs-engine |
| Grade entries from the command line | @buzzr/dfs-cli |
The regression fixtures are review gates for a matching engine version, not official operator conformance.
Node.js >= 22 is supported. Import the supported API from @buzzr/dfs-testkit.
Deep src/* and dist/* imports are unsupported. The package is intended for
development and test dependencies and uses the compatible @buzzr/dfs-engine
range declared in its package manifest.
Report vulnerabilities privately through SECURITY.md. The versioning and support policy defines the supported runtime and SemVer contract.
FAQs
Fixture builders and mock providers for @buzzr/dfs-engine consumers.
We found that @buzzr/dfs-testkit 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.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.

Company News
Socket is now in the AWS Security Hub Extended plan. Adopt it through AWS, apply committed spend, and block malicious open source packages.