Skip to content

TypeMoq stops recording mocked invocations after 3 times #140

Description

@peterwbeck

Background
My target class is constructed with a UnitOfWorkFactory instance. This instance encapsulates a reusable piece of code for creating transactions in TypeORM. This is done within the trans method. The trans method takes an async lambda and executes it within a transactional context.

Issue
When the trans method is mocked and a callback is setup to manually execute the async lambda parameter, any other executions of mocked services inside of the async lambdas are not counted after the 3rd invocation.

JSFiddle link here https://jsfiddle.net/peterwbeck/t271b630/

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions