guerilla
v0.1.1
Published
Injects targeted fault and input perturbations into tests to reveal hidden edge cases.
Readme
guerilla
Injects targeted fault and input perturbations into tests to reveal hidden edge cases.
Features
- Integrates with common Node test runners (Jest, Mocha) to augment existing tests.
- Configurable injection scenarios: network faults, timing perturbations, memory pressure, and input fuzzing.
- Deterministic seeding, probability controls, and safe rollback after each test run.
- CI-friendly toggles and low runtime overhead for selective activation.
Install
npm install guerillaQuick Start
const guerilla = require('guerilla');
// Enable and seed for deterministic runs
guerilla.configure({ enabled: true, seed: 42 });
// Define a scenario: intermittent network delay
guerilla.scenario('intermittent-network', {
type: 'networkDelay',
min: 50, // ms
max: 300, // ms
probability: 0.25
});
// Wrap a test or async operation so the injections apply only during execution
await guerilla.run(async () => {
const result = await fetchData();
// assertions...
});
// In a test runner (Jest/Mocha) you can enable scenarios per-test:
// beforeEach(() => guerilla.activate('intermittent-network'));
// afterEach(() => guerilla.deactivate());License
MIT
