Skip to content

Commit 83ad99d

Browse files
committed
fix: update component testing guide
1 parent d51214a commit 83ad99d

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

docs/guides/component-testing.mdx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,19 @@ export const {
7070
}
7171
```
7272

73+
also add the `"jsx": "react-jsx"` compile option to your tsconfig.json:
74+
75+
```typescript title="tsconfig.json"
76+
{
77+
"compilerOptions": {
78+
"types": [
79+
// ...
80+
],
81+
"jsx": "react-jsx"
82+
}
83+
}
84+
```
85+
7386
### Step 4: Write a test
7487

7588
To check the correct configuration, we can write the simplest test in which we output the `document` value to the console without using the [browser.execute][browser-execute] command:
@@ -136,6 +149,8 @@ function Component() {
136149
</div>
137150
);
138151
}
152+
153+
export default Component;
139154
```
140155

141156
A fully working examples can be found [here][testplane-examples-component-testing].

i18n/ru/docusaurus-plugin-content-docs/current/guides/component-testing.mdx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,19 @@ export default {
6666
};
6767
```
6868

69+
также добавьте параметр компиляции `"jsx": "react-jsx"` в ваш файл tsconfig.json:
70+
71+
```typescript title="tsconfig.json"
72+
{
73+
"compilerOptions": {
74+
"types": [
75+
// ...
76+
],
77+
"jsx": "react-jsx"
78+
}
79+
}
80+
```
81+
6982
### Шаг 4: Написание теста
7083

7184
Чтобы проверить правильную конфигурацию, мы можем написать самый простой тест, в котором выводим значение document в консоль без использования команды [browser.execute][browser-execute]:
@@ -132,6 +145,8 @@ function Component() {
132145
</div>
133146
);
134147
}
148+
149+
export default Component;
135150
```
136151

137152
Полностью работающие примеры можно найти [здесь][testplane-examples-component-testing].

0 commit comments

Comments
 (0)