
Security News
White House Authorizes Private Companies to Conduct Offensive Cyber Operations
A new federal program will let vetted U.S. cybersecurity firms help investigate and disrupt foreign cybercrime groups under government direction.
@buzzr/dfs-testkit
Advanced tools
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 |
| Prove your wiring grades identically to Buzzr's | @buzzr/dfs-engine-test-vectors |
| Grade entries in production code | @buzzr/dfs-engine |
| Grade entries from the command line | @buzzr/dfs-cli |
MIT
FAQs
Fixture builders and mock providers for @buzzr/dfs-engine consumers.
The npm package @buzzr/dfs-testkit receives a total of 23 weekly downloads. As such, @buzzr/dfs-testkit popularity was classified as not popular.
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
A new federal program will let vetted U.S. cybersecurity firms help investigate and disrupt foreign cybercrime groups under government direction.

Research
/Security News
The campaign amassed more than 75,000 installs by targeting Russian-speaking users seeking access to blocked services.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.