Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate use of Proxies for mocking #6

Open
jamesadarich opened this issue Nov 1, 2016 · 0 comments
Open

Investigate use of Proxies for mocking #6

jamesadarich opened this issue Nov 1, 2016 · 0 comments

Comments

@jamesadarich
Copy link
Member

Using proxies could get over the issue faced with interfaces having no definition at runtime however we'd need to make assumptions between functions and properties when determining what value to return

Mock<T>(T); // creates a mock based on the passed prototype

Mock<I>(); // creates a mock using a Proxy assuming all properties are FunctionSpies

Then properties should be overridden by something like

SetProperty(mock.property).to(42);

CallingFunction(mock.function).returns(42)

to define explicitly whether a property is a FunctionSpy or PropertySpy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant