Skip to content

refactor(docusarus): docusaurus migration #612

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

Merged
merged 41 commits into from
Nov 4, 2020
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
b01435e
refactor(docusarus): initial commit for docusaurus migration
MatanBobi Sep 12, 2020
0a1afe6
update gitignore
MatanBobi Sep 12, 2020
015abb9
fix build
MatanBobi Sep 12, 2020
a0bc949
multiple fixes for build
MatanBobi Sep 12, 2020
63fb9b6
update netlify to correct build route
MatanBobi Sep 12, 2020
f9e2241
fix sidebars
MatanBobi Sep 12, 2020
60b1b8a
add website-old temporarily to gitignore
MatanBobi Sep 12, 2020
50d17d3
update README
MatanBobi Sep 13, 2020
ae9626b
CSS Fixes and MultiLingualCodeBlock
MatanBobi Sep 14, 2020
9c53bb4
Fix help page layout
MatanBobi Sep 14, 2020
710e1de
add MarkdownBlock component
MatanBobi Sep 15, 2020
67879fd
Footer fixes
MatanBobi Sep 16, 2020
4ca3db6
fix footer github button
MatanBobi Sep 16, 2020
0ac2cc3
Remove the logos that dont look good on dark mode
MatanBobi Sep 16, 2020
0b83c14
Fix users page and buttons
MatanBobi Sep 16, 2020
df1c893
fix: broken users link from home page
MatanBobi Sep 16, 2020
7dc05f9
refactor: extract showcase and rename js to jsx
MatanBobi Sep 16, 2020
d529784
fix broken build
MatanBobi Sep 16, 2020
0d35c2b
fix: broken links in md
MatanBobi Sep 17, 2020
1886df8
merge master
MatanBobi Oct 2, 2020
341f720
Merge branch 'master' into pr/migrate-ducusaurus
MatanBobi Oct 2, 2020
80ac83b
fix: fix showcase
MatanBobi Oct 2, 2020
fa4e994
update api-events to contain new code tabs
MatanBobi Oct 3, 2020
dccc394
rename all md to mdx
MatanBobi Oct 3, 2020
5258c68
Revert "rename all md to mdx"
MatanBobi Oct 3, 2020
ad1fac6
migrate all md to mdx and change links
MatanBobi Oct 3, 2020
dfbcb46
code review fix - put imports at the top
MatanBobi Oct 3, 2020
859a470
Merge remote-tracking branch 'upstream/master' into pr/migrate-ducusa…
MatanBobi Oct 9, 2020
2eba03b
migrate to npm
MatanBobi Oct 9, 2020
29f89a5
remove unnecessary code and css
MatanBobi Oct 10, 2020
b00a780
Merge remote-tracking branch 'upstream/master'
MatanBobi Oct 13, 2020
590af0e
remove unnecessary code
MatanBobi Oct 13, 2020
33dbab9
remove yarn.lock
MatanBobi Oct 13, 2020
734dcb7
fix: multiple ui fixes and blog sidebar
MatanBobi Oct 28, 2020
a44c70c
fix help appearing in two places
MatanBobi Oct 28, 2020
e819a60
add missing global-cto-forum logo
MatanBobi Oct 28, 2020
e195402
remove docker and add code snippets for mdx
MatanBobi Nov 1, 2020
e94c990
Merge remote-tracking branch 'upstream/master'
MatanBobi Nov 1, 2020
49ce488
Merge branch 'master' into pr/migrate-ducusaurus
MatanBobi Nov 1, 2020
cf466ea
pull the website directory outside
MatanBobi Nov 3, 2020
ef64020
fix light background in stripes
MatanBobi Nov 3, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ website/build/
website/yarn.lock
website/node_modules
website/i18n/*
website/.docusaurus
website/.cache-loader
website-old

*.log

Expand Down
18 changes: 9 additions & 9 deletions docs/dom-testing-library/api-async.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ The default `onTimeout` takes the error and appends the `container`'s printed
state to the error message which should hopefully make it easier to track down
what caused the timeout.

<a name="mutationobserveroptions"></a>The default `mutationObserverOptions` is
The default `mutationObserverOptions` is
`{subtree: true, childList: true, attributes: true, characterData: true}` which
will detect additions and removals of child elements (including text nodes) in
the `container` and any of its descendants. It will also detect attribute
Expand Down Expand Up @@ -99,14 +99,14 @@ el.parentElement.removeChild(el)
or an empty array:

```javascript
waitForElementToBeRemoved(null).catch(err => console.log(err))
waitForElementToBeRemoved(queryByText(/not here/i)).catch(err =>
waitForElementToBeRemoved(null).catch((err) => console.log(err))
waitForElementToBeRemoved(queryByText(/not here/i)).catch((err) =>
console.log(err)
)
waitForElementToBeRemoved(queryAllByText(/not here/i)).catch(err =>
waitForElementToBeRemoved(queryAllByText(/not here/i)).catch((err) =>
console.log(err)
)
waitForElementToBeRemoved(() => getByText(/not here/i)).catch(err =>
waitForElementToBeRemoved(() => getByText(/not here/i)).catch((err) =>
console.log(err)
)

Expand Down Expand Up @@ -158,7 +158,7 @@ changed:
const container = document.createElement('div')
waitForDomChange({ container })
.then(() => console.log('DOM changed!'))
.catch(err => console.log(`Error you need to deal with: ${err}`))
.catch((err) => console.log(`Error you need to deal with: ${err}`))
container.append(document.createElement('p'))
// if 👆 was the only code affecting the container and it was not run,
// waitForDomChange would throw an error
Expand All @@ -172,7 +172,7 @@ container
```javascript
const container = document.createElement('div')
container.setAttribute('data-cool', 'true')
waitForDomChange({ container }).then(mutationsList => {
waitForDomChange({ container }).then((mutationsList) => {
const mutation = mutationsList[0]
console.log(
`was cool: ${mutation.oldValue}\ncurrently cool: ${mutation.target.dataset.cool}`
Expand All @@ -192,7 +192,7 @@ wait for are descendants of `container`.
The default `timeout` is `1000ms` which will keep you under
[Jest's default timeout of `5000ms`](https://jestjs.io/docs/en/jest-object.html#jestsettimeouttimeout).

<a name="mutationobserveroptions"></a>The default `mutationObserverOptions` is
The default `mutationObserverOptions` is
`{subtree: true, childList: true, attributes: true, characterData: true}` which
will detect additions and removals of child elements (including text nodes) in
the `container` and any of its descendants. It will also detect attribute
Expand Down Expand Up @@ -251,7 +251,7 @@ wait for will be attached to it, or set a different `container`.
The default `timeout` is `4500ms` which will keep you under
[Jest's default timeout of `5000ms`](https://facebook.github.io/jest/docs/en/jest-object.html#jestsettimeouttimeout).

<a name="mutationobserveroptions"></a>The default `mutationObserverOptions` is
The default `mutationObserverOptions` is
`{subtree: true, childList: true, attributes: true, characterData: true}` which
will detect additions and removals of child elements (including text nodes) in
the `container` and any of its descendants. It will also detect attribute
Expand Down
6 changes: 3 additions & 3 deletions docs/dom-testing-library/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ Please refer to the [Guiding Principles](../guiding-principles) of this testing
library for more info.

</details>
<!--
Links:
-->

<!-- Links: -->


<!-- prettier-ignore-start -->

Expand Down
2 changes: 1 addition & 1 deletion docs/example-codesandbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ You can find runnable examples for many common use cases on Codesandbox.

[![Open react-testing-library-examples](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/kentcdodds/react-testing-library-examples/tree/master/)

<iframe src="https://codesandbox.io/embed/github/kentcdodds/react-testing-library-examples/tree/master/?expanddevtools=1&fontsize=13&hidenavigation=1&initialpath=%2F__tests__%2Fasync.js&module=%2Fsrc%2F__tests__%2Fasync.js&moduleview=1&previewwindow=tests&view=editor" style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;" sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"></iframe>
<iframe src="https://codesandbox.io/embed/github/kentcdodds/react-testing-library-examples/tree/master/?expanddevtools=1&fontsize=13&hidenavigation=1&initialpath=%2F__tests__%2Fasync.js&module=%2Fsrc%2F__tests__%2Fasync.js&moduleview=1&previewwindow=tests&view=editor" style={{width: '100%', height:500, border:0, borderRadius: 4, overflow:'hidden'}} sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"></iframe>

## Playground

Expand Down
2 changes: 1 addition & 1 deletion docs/example-external.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ sidebar_label: External Examples
Tolinski

<a href="https://youtu.be/JKOwJUM4_RM">
<img width="200px" alt="what is react testing library" src='https://img.youtube.com/vi/JKOwJUM4_RM/0.jpg' style="margin-left: 36px" />
<img width="200px" alt="what is react testing library" src='https://img.youtube.com/vi/JKOwJUM4_RM/0.jpg' style={{marginLeft: 36}} />
</a>
4 changes: 3 additions & 1 deletion docs/intro.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
id: intro
title: Introduction
slug: /
---

The [`@testing-library`][npm] family of packages helps you test UI components in
Expand Down Expand Up @@ -45,7 +46,8 @@ Testing Library encourages you to avoid testing
[implementation details](https://kentcdodds.com/blog/testing-implementation-details)
like the internals of a component you're testing (though it's still possible).
[The Guiding Principles](/docs/guiding-principles) of this library emphasize a
focus on tests that closely resemble how your web pages are interacted by the users.
focus on tests that closely resemble how your web pages are interacted by the
users.

You may want to avoid following implementation details:

Expand Down
13 changes: 11 additions & 2 deletions docs/marko-testing-library/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ title: API
as these methods:

- [`render`](#render)
- [`render` Options](#render-options)
- [`container`](#container)
- [`render` Result](#render-result)
- [`...queries`](#queries)
- [`debug`](#debug)
- [`rerender`](#rerender)
- [`emitted`](#emitted)
- [`container`](#container-1)
- [`cleanup`](#cleanup)

---
Expand Down Expand Up @@ -207,8 +215,9 @@ expect(emitted()).toMatchInlineSnapshot(`
### `container`

The containing DOM node of your rendered Marko Component. For server side tests
this is a [JSDOM.fragment](), and for client side tests this will be whatever is
passed as the `container` render option.
this is a [JSDOM.fragment](https://github.com/jsdom/jsdom#fragment), and for
client side tests this will be whatever is passed as the `container` render
option.

> Tip: To get the root element of your rendered element, use
> `container.firstChild`.
Expand Down
3 changes: 0 additions & 3 deletions docs/react-native-testing-library/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ with this file in all your imports. See
[below](#configuring-jest-with-test-utils) for a way to make your test util file
accessible without using relative paths.

The example below sets up data providers using the
[`wrapper`](api-render.md#render-options) option to `render`.

```diff
// my-component.test.js
- import { render, fireEvent } from '@testing-library/react-native';
Expand Down
2 changes: 1 addition & 1 deletion docs/react-testing-library/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Have a look at the "What is React Testing library?" video below for an
introduction to the library.

<a href="https://youtu.be/JKOwJUM4_RM">
<img width="200px" alt="what is react testing library" src='https://img.youtube.com/vi/JKOwJUM4_RM/0.jpg' style="margin-left: 0" />
<img width="200px" alt="what is react testing library" src='https://img.youtube.com/vi/JKOwJUM4_RM/0.jpg' style={{marginLeft: 0}} />
</a>

Also, don't miss this
Expand Down
5 changes: 0 additions & 5 deletions docs/react-testing-library/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ export { customRender as render }
> [#169](https://github.com/testing-library/react-testing-library/issues/169)
> and the workaround below.

<details>
<summary>Workaround for Babel 6</summary>

You can use CommonJS modules instead of ES modules, which should work in Node:
Expand All @@ -90,8 +89,6 @@ module.exports = {
}
```

</details>

### Add custom queries

> **Note**
Expand Down Expand Up @@ -175,8 +172,6 @@ const { getByDataCy } = render(<Component />)
expect(getByDataCy('my-component')).toHaveTextContent('Hello')
```

</details>

### Configuring Jest with Test Utils

To make your custom test file accessible in your Jest test files without using
Expand Down
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Directory (relative to root of your repo) that contains the deploy-ready
# HTML files and assets generated by the build. If a base directory has
# been specified, include it in the publish directory path.
publish = "website/build/testing-library-docs"
publish = "website/build"

# Default build command.
command = "cd website; npm install; npm run format-docs; npm run build"
Expand Down
Loading