question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Success message of "msw init" contains a misleading API example

See original GitHub issue

Current behavior

Current success message of running msw init command is:

https://github.com/open-draft/msw/blob/1fc124726f2d6b1e76e5cb7bfe306d94b3061acd/cli/init.js#L29-L34

The API example illustrated in the message is misleading, as the library does not export the msw namespace, neither that namespace has the start() method.

Expected behavior

The message of successfully running the msw init command should link the developer to the documentation.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
kettanaitocommented, Mar 13, 2020

Fixed by #63. Released in 0.8.1.

Thank you, @hehehai! Your contributions are highly appreciated.

1reaction
hehehaicommented, Mar 11, 2020

@kettanaito Yes this is a good idea

What do you think of demandCommand and example below, which can give developers some feedback on their use.

now cli,No feedback

$ npx msw

image

command check

yargs
	// ......
	.help()
	.demandCommand().argv
$ npx msw

image

command example

(yargs) => {
      // builder
      yargs
        .positional('publicDir', {
          type: 'string',
          description: 'Relative path to server public directory',
          required: true,
          normalize: true,
        },
        .example('init', 'msw init public')
        .help()
    },

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Success message of "msw init" contains a misleading API ...
The API example illustrated in the message is misleading, as the library does not export the msw namespace, neither that namespace has the...
Read more >
Using Storybook and Mock Service Worker for mocked API ...
Storybook page showcasing our “GitHubUser” component receiving the mocked response. You can see that our request has been successfully handled ...
Read more >
Testing React Components with Testing Library and Mock ...
If you ever wondered: how can I test a component that makes API calls?, or should I mock the HTTP client?, then this...
Read more >
Request assertions - Recipes - Mock Service Worker Docs
Examples of such assertions can include: Check that the tested code has dispatched a request;; Check that a request was issued with the ......
Read more >
Redux store not being populated when mocking API call
I'm using Mock Service Worker (MSW) to mock the API call. This is my first time for writing these kind of tests so...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found