-
Notifications
You must be signed in to change notification settings - Fork 2
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
docs: fix component testing example #10
Conversation
✅ Successfully deployed static |
blog/component-testing.mdx
Outdated
@@ -108,25 +108,34 @@ it("should log document", async () => { | |||
} | |||
``` | |||
|
|||
Напишем более сложный тест с рендерингом react компонента: | |||
Напишем более сложный тест с рендерингом react компонента. Для этого сначала напишем небольшой компонент: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Тут у тебя react
с маленькой
export default Component; | ||
``` | ||
|
||
И напишем сам тест, который будет тестировать наш React-компонент: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А тут React с большой.
Давай сделаем одинаково
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
сделал с большой везде
4430c7c
to
e77c203
Compare
<button onClick={() => setCount(count => count + 1)}>count is {count}</button> | ||
</div> | ||
); | ||
} | ||
|
||
export default Component; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Можно сразу выше написать - export default function Component() {...}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Тогда можно и сразу export default function() {...}
Если суть PR в том, что в одном файле не работает, мб это явно подсветить в warning блоке каком-нибудь? Звучит как полезная и неочевидная штука |
e77c203
to
eb5c73c
Compare
мы просто это пофиксим. но на момент митапа хочется, чтобы пример уже был рабочим |
No description provided.