Skip to content

Excessive warn "was both stubbed and verified" #148

@moeriki

Description

@moeriki

I have the following test.

it('should keep result in memory', function () {
  // setup
  td.replace(testStore, 'get');
  td.when(
    testStore.get('myStore')
  ).thenResolve('[]');
  const manager = storyManager('myStore');
  // test
  return manager.get().then(() =>
    manager.get().then(() => {
      td.verify(testStore.get('myStore'), { times: 1 });
    })
  );
});

Which yields the warning test double 'get' was both stubbed and verified. Yet I cannot remove the stub, because it needs to resolve a Promise. Neither can I remove the verify because I need to check if times is 1 for my test to be correct.

Can we consider not warning when times is used in verification?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions