Skip to content

Commit

Permalink
chore(website): ManualMocks admonitions (#13593)
Browse files Browse the repository at this point in the history
  • Loading branch information
notoriousmango committed Jan 1, 2023
1 parent 6a2bb4e commit 77077ea
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 10 deletions.
8 changes: 7 additions & 1 deletion docs/ManualMocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ Manual mocks are used to stub out functionality with mock data. For example, ins

## Mocking user modules

Manual mocks are defined by writing a module in a `__mocks__/` subdirectory immediately adjacent to the module. For example, to mock a module called `user` in the `models` directory, create a file called `user.js` and put it in the `models/__mocks__` directory. Note that the `__mocks__` folder is case-sensitive, so naming the directory `__MOCKS__` will break on some systems.
Manual mocks are defined by writing a module in a `__mocks__/` subdirectory immediately adjacent to the module. For example, to mock a module called `user` in the `models` directory, create a file called `user.js` and put it in the `models/__mocks__` directory.

:::caution

The `__mocks__` folder is case-sensitive, so naming the directory `__MOCKS__` will break on some systems.

:::

:::note

Expand Down
10 changes: 8 additions & 2 deletions website/versioned_docs/version-25.x/ManualMocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ Manual mocks are used to stub out functionality with mock data. For example, ins

## Mocking user modules

Manual mocks are defined by writing a module in a `__mocks__/` subdirectory immediately adjacent to the module. For example, to mock a module called `user` in the `models` directory, create a file called `user.js` and put it in the `models/__mocks__` directory. Note that the `__mocks__` folder is case-sensitive, so naming the directory `__MOCKS__` will break on some systems.
Manual mocks are defined by writing a module in a `__mocks__/` subdirectory immediately adjacent to the module. For example, to mock a module called `user` in the `models` directory, create a file called `user.js` and put it in the `models/__mocks__` directory.

::note
:::caution

The `__mocks__` folder is case-sensitive, so naming the directory `__MOCKS__` will break on some systems.

:::

:::note

When we require that module in our tests (meaning we want to use the manual mock instead of the real implementation), explicitly calling `jest.mock('./moduleName')` is **required**.

Expand Down
8 changes: 7 additions & 1 deletion website/versioned_docs/version-26.x/ManualMocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ Manual mocks are used to stub out functionality with mock data. For example, ins

## Mocking user modules

Manual mocks are defined by writing a module in a `__mocks__/` subdirectory immediately adjacent to the module. For example, to mock a module called `user` in the `models` directory, create a file called `user.js` and put it in the `models/__mocks__` directory. Note that the `__mocks__` folder is case-sensitive, so naming the directory `__MOCKS__` will break on some systems.
Manual mocks are defined by writing a module in a `__mocks__/` subdirectory immediately adjacent to the module. For example, to mock a module called `user` in the `models` directory, create a file called `user.js` and put it in the `models/__mocks__` directory.

:::caution

The `__mocks__` folder is case-sensitive, so naming the directory `__MOCKS__` will break on some systems.

:::

:::note

Expand Down
8 changes: 7 additions & 1 deletion website/versioned_docs/version-27.x/ManualMocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ Manual mocks are used to stub out functionality with mock data. For example, ins

## Mocking user modules

Manual mocks are defined by writing a module in a `__mocks__/` subdirectory immediately adjacent to the module. For example, to mock a module called `user` in the `models` directory, create a file called `user.js` and put it in the `models/__mocks__` directory. Note that the `__mocks__` folder is case-sensitive, so naming the directory `__MOCKS__` will break on some systems.
Manual mocks are defined by writing a module in a `__mocks__/` subdirectory immediately adjacent to the module. For example, to mock a module called `user` in the `models` directory, create a file called `user.js` and put it in the `models/__mocks__` directory.

:::caution

The `__mocks__` folder is case-sensitive, so naming the directory `__MOCKS__` will break on some systems.

:::

:::note

Expand Down
8 changes: 7 additions & 1 deletion website/versioned_docs/version-28.x/ManualMocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ Manual mocks are used to stub out functionality with mock data. For example, ins

## Mocking user modules

Manual mocks are defined by writing a module in a `__mocks__/` subdirectory immediately adjacent to the module. For example, to mock a module called `user` in the `models` directory, create a file called `user.js` and put it in the `models/__mocks__` directory. Note that the `__mocks__` folder is case-sensitive, so naming the directory `__MOCKS__` will break on some systems.
Manual mocks are defined by writing a module in a `__mocks__/` subdirectory immediately adjacent to the module. For example, to mock a module called `user` in the `models` directory, create a file called `user.js` and put it in the `models/__mocks__` directory.

:::caution

The `__mocks__` folder is case-sensitive, so naming the directory `__MOCKS__` will break on some systems.

:::

:::note

Expand Down
8 changes: 7 additions & 1 deletion website/versioned_docs/version-29.0/ManualMocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ Manual mocks are used to stub out functionality with mock data. For example, ins

## Mocking user modules

Manual mocks are defined by writing a module in a `__mocks__/` subdirectory immediately adjacent to the module. For example, to mock a module called `user` in the `models` directory, create a file called `user.js` and put it in the `models/__mocks__` directory. Note that the `__mocks__` folder is case-sensitive, so naming the directory `__MOCKS__` will break on some systems.
Manual mocks are defined by writing a module in a `__mocks__/` subdirectory immediately adjacent to the module. For example, to mock a module called `user` in the `models` directory, create a file called `user.js` and put it in the `models/__mocks__` directory.

:::caution

The `__mocks__` folder is case-sensitive, so naming the directory `__MOCKS__` will break on some systems.

:::

:::note

Expand Down
8 changes: 7 additions & 1 deletion website/versioned_docs/version-29.1/ManualMocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ Manual mocks are used to stub out functionality with mock data. For example, ins

## Mocking user modules

Manual mocks are defined by writing a module in a `__mocks__/` subdirectory immediately adjacent to the module. For example, to mock a module called `user` in the `models` directory, create a file called `user.js` and put it in the `models/__mocks__` directory. Note that the `__mocks__` folder is case-sensitive, so naming the directory `__MOCKS__` will break on some systems.
Manual mocks are defined by writing a module in a `__mocks__/` subdirectory immediately adjacent to the module. For example, to mock a module called `user` in the `models` directory, create a file called `user.js` and put it in the `models/__mocks__` directory.

:::caution

The `__mocks__` folder is case-sensitive, so naming the directory `__MOCKS__` will break on some systems.

:::

:::note

Expand Down
8 changes: 7 additions & 1 deletion website/versioned_docs/version-29.2/ManualMocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ Manual mocks are used to stub out functionality with mock data. For example, ins

## Mocking user modules

Manual mocks are defined by writing a module in a `__mocks__/` subdirectory immediately adjacent to the module. For example, to mock a module called `user` in the `models` directory, create a file called `user.js` and put it in the `models/__mocks__` directory. Note that the `__mocks__` folder is case-sensitive, so naming the directory `__MOCKS__` will break on some systems.
Manual mocks are defined by writing a module in a `__mocks__/` subdirectory immediately adjacent to the module. For example, to mock a module called `user` in the `models` directory, create a file called `user.js` and put it in the `models/__mocks__` directory.

:::caution

The `__mocks__` folder is case-sensitive, so naming the directory `__MOCKS__` will break on some systems.

:::

:::note

Expand Down
8 changes: 7 additions & 1 deletion website/versioned_docs/version-29.3/ManualMocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ Manual mocks are used to stub out functionality with mock data. For example, ins

## Mocking user modules

Manual mocks are defined by writing a module in a `__mocks__/` subdirectory immediately adjacent to the module. For example, to mock a module called `user` in the `models` directory, create a file called `user.js` and put it in the `models/__mocks__` directory. Note that the `__mocks__` folder is case-sensitive, so naming the directory `__MOCKS__` will break on some systems.
Manual mocks are defined by writing a module in a `__mocks__/` subdirectory immediately adjacent to the module. For example, to mock a module called `user` in the `models` directory, create a file called `user.js` and put it in the `models/__mocks__` directory.

:::caution

The `__mocks__` folder is case-sensitive, so naming the directory `__MOCKS__` will break on some systems.

:::

:::note

Expand Down

0 comments on commit 77077ea

Please sign in to comment.