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

Decide on class signature #6

Closed
kettanaito opened this issue Nov 17, 2018 · 1 comment
Closed

Decide on class signature #6

kettanaito opened this issue Nov 17, 2018 · 1 comment

Comments

@kettanaito
Copy link
Member

kettanaito commented Nov 17, 2018

Usage of classes implies multiple instances of that class. However, this is not the use case for mocking, as you would expect to have a mocking interface configured at one place, once.

const msw = new MSW()

The end usage is also ugly.

Suggestions

Internal usage of class is fine, but it may make sense to expose the instantiated instance of that class to the end developer.

import msw from 'msw'

msw.get(...)
@kettanaito
Copy link
Member Author

As of 0.1.1 the library exposes already instantiated class:

import { msw } from 'msw'

msw.get('...')

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