Skip to content
This repository has been archived by the owner on Aug 24, 2023. It is now read-only.

Improve examples #17

Open
thomaschaplin opened this issue Mar 31, 2021 · 8 comments
Open

Improve examples #17

thomaschaplin opened this issue Mar 31, 2021 · 8 comments
Labels
documentation Improvements or additions to documentation question Further information is requested

Comments

@thomaschaplin
Copy link
Member

The following points have been raised when the tool was being presented:

  • The examples could be more accessible
@thomaschaplin thomaschaplin added documentation Improvements or additions to documentation help wanted Extra attention is needed labels Mar 31, 2021
@thomaschaplin
Copy link
Member Author

We need to document what needs improving before this issue can be worked on

@thomaschaplin thomaschaplin added question Further information is requested and removed help wanted Extra attention is needed labels Mar 31, 2021
@aychtang
Copy link

aychtang commented Jun 18, 2021

I think it would benefit from some more real world kind of use cases, for example the graphql responses used are not actual GQL response structures but mocked to provide an example of timing differences.

It would be good to provide step by step introductions to common use cases like:

  • Mock a request in nodejs test
  • Mock a request in jest
  • Mock a request in jest for a React component

and similar common scenarios we expect.

The intros should provide some more fundamental understanding for users wanting to learn.. and also some result to copy and paste for users who want to be lazy 🙂

@aychtang
Copy link

aychtang commented Jun 18, 2021

Examples in readme should include imports (we do for some, but definitely the first one on the page should have it too)

@aychtang
Copy link

I added this PR #73 which i think is a good MVP of a full example showing how to mock a request, use that mockedRequest object in a test suite and logging the mocked data from the src file.

@rickschubert
Copy link
Contributor

Hi Howard! I have only just now seen this as well as your PR - I don't seem to get notifications anymore now that I'm not in the trayio organization.

Could you please outline further what examples you would like to have and how you would expect them to look like? I'm asking as I'm all for more examples but I'm not clear yet on the proposed structure in PR #73. Also, what do you mean by "nodejs test" - jest runs already on nodejs. It would be nice though having a mocha example which shows how cleanUpNetworkRequestMocking() etc. has to be called in the start-up phase.

In the readme we write:

For detailed examples on how to use each of these, check out our extensive suite of tests.

Perhaps we could instead link to specific tests in the readme? And make it clear where the start-up phase is happening and how it's done?

@rickschubert
Copy link
Contributor

☝️ @aychtang as you might have not gotten a notification due to me not mentioning the GitHub name :)

@aychtang
Copy link

aychtang commented Jun 24, 2021

Oh, hey @rickschubert - hope you've been well! Think if you watch the repo (next to star + fork) you will get notifications for these PR messages.

Was just a quick list I typed, not meant to be exhaustive, but basically the idea is like there should be "use case examples" for testing from say a file using stdlib of nodejs, one for express, one for react etc. I'm actually starting to think that these should live as totally separate repos which are linked to from the README, as they will have devdependencies which are not really related to mock-inspect and I don't like the idea of passing those dependency requirements on to users of mock-inspect.

So we should move that PR to mock-inspect-example-nodejs and add mock-inspect-example-react and stuff like that as we go, what do you think @rickschubert @thomaschaplin?

@thomaschaplin
Copy link
Member Author

I don't think this should live inside the mock-inspect repo as you've said @aychtang.

@aychtang suggested about using VS Code Tours - https://marketplace.visualstudio.com/items?itemName=vsls-contrib.codetour

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants