Skip to content

Commit

Permalink
feat: add option to disable snapshots
Browse files Browse the repository at this point in the history
add tests
  • Loading branch information
Gautam Jethwani committed Jul 31, 2023
1 parent 7dd76f0 commit 0e97360
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions test/status-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,40 @@ test('CircuitBreaker status - import stats,but not a status object', t => {
t.fail();
}
});

test('CircuitBreaker status - enableSnapshots defaults to true', t => {
t.plan(1);

const breaker = new CircuitBreaker(passFail);

t.equal(breaker.status.enableSnapshots, true, 'enableSnapshots defaults to true');

breaker.shutdown();
t.end();
});

test('CircuitBreaker status - enableSnapshots is true in Status when set to true', t => {
t.plan(1);

const breaker = new CircuitBreaker(passFail, {
enableSnapshots: true
});

t.equal(breaker.status.enableSnapshots, true, 'enableSnapshots propagates as true');

breaker.shutdown();
t.end();
});

test('CircuitBreaker status - enableSnapshots is false in Status when set to false', t => {
t.plan(1);

const breaker = new CircuitBreaker(passFail, {
enableSnapshots: false
});

t.equal(breaker.status.enableSnapshots, false, 'enableSnapshots propagates as false');

breaker.shutdown();
t.end();
});

0 comments on commit 0e97360

Please sign in to comment.