Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: jonniebigodes <joaocontadesenvolvimento@gmail.com>
  • Loading branch information
kylegach and jonniebigodes authored Apr 30, 2024
1 parent d12b61a commit 80b4168
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/writing-stories/build-pages-with-storybook.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Components can receive data or configuration from context providers. For example

### [Mocking API Services](./mocking-network-requests.md)

For components that make network requests (e.g. fetching data from a REST or GraphQL API), you can mock those requests in your stories.
For components that make network requests (e.g., fetching data from a REST or GraphQL API), you can mock those requests in your stories.

### [Mocking imports](./mocking-modules.md)

Expand Down
4 changes: 2 additions & 2 deletions docs/writing-stories/mocking-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const getUserFromSession = fn(actual.getUserFromSession);

### Mock files for external modules

You can't directly mock an external module like `uuid` or `node:fs`. Instead, you must wrap the module in you own module, which you can then mock like any other internal module. In this example, we wrap `uuid`:
You can't directly mock an external module like [`uuid`](https://github.com/uuidjs/uuid) or `node:fs`. Instead, you must wrap it in your own module, which you can mock like any other internal one. For example, with `uuid`, you could do the following:

```ts
// lib/uuid.ts
Expand Down Expand Up @@ -190,7 +190,7 @@ export const Default: Story = {

<Callout variant="info">

If you are [writing your stories in TypeScript](./typescript.md), you will need to import your mock modules using the full mocked file name to have the mocked function correctly typed in your stories. You do **not** need do this in your component files, that's what the [subpath import](#subpath-imports) or [builder alias](#builder-aliases) is for.
If you are [writing your stories in TypeScript](./typescript.md), you must import your mock modules using the full mocked file name to have the functions correctly typed in your stories. You do **not** need to do this in your component files. That's what the [subpath import](#subpath-imports) or [builder alias](#builder-aliases) is for.

</Callout>

Expand Down

0 comments on commit 80b4168

Please sign in to comment.