mbraude / TeddyMocks

A simple mock framework for Javascript, written in and optimized for TypeScript development
8 stars 3 forks source link

Mocking Interfaces #5

Open Waog opened 9 years ago

Waog commented 9 years ago

It would be a nice convenient method to create mocks interfaces the same way, one can do it for classes.

Currently I have to introduce some class in my tests, to pass it to the Stub constructor, because it can't handle no-constructor-types:

    class MyMockingInterfaceClass implements MyInterface {
        someMethod() {throw "method should be replaced by mock"}
    }

This are only 3 lines for this simple example, but becomes really nasty for bigger interfaces.