Skip to content

No obvious way to reset fakes #1815

@akdor1154

Description

@akdor1154

Describe the bug
There's no obvious or documented way to reset the history of all fakes.

To Reproduce

const sinon = require('sinon');
const fake = sinon.fake();
fake(1234);
sinon.resetHistory();
fake.getCalls() // returns [Call(1234)]

sinon.reset();
fake.getCalls() // returns [Call(1234)]
const sandbox = sinon.createSandbox();
const fake = sandbox.fake() // error, can't make fakes from sandboxes (why??)

Expected behavior
All the above behaviours should return [] instead of [Call(1234), and sandboxes should be able to create fakes (in order to reset a set of fakes together).

  • Library version: 5.0.10
  • Environment: ubuntu 18.04

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions