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

Support .returns() with static value #130

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

parisholley
Copy link

@parisholley parisholley commented Aug 27, 2019

It is annoying to always use a function because of the following use case:

interface Wee {
  value?: string
}

let test:Wee = {value: 'foobar'};

if (test) {
  mock.setup(m => m.do()).returns(() => test);
}

typescript will complain because test can be "undefined"

@tobysmith568
Copy link

Hi @parisholley

The author of Typemoq, @florinn, hasn't been active on Github for a couple of years now. In order to keep Typemoq progressing I have created a fork over at https://github.com/typemoq/typemoq-continued where I would like us as a community to continue development while Florinn is absent.

If you would like, I invite you to create a PR over on that repo where this feature can then be merged in. The new repo is on NPM under typemoq-continued.

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

Successfully merging this pull request may close these issues.

2 participants