diff --git a/docs/guides/component-testing.mdx b/docs/guides/component-testing.mdx index 638c9f5..59401c8 100644 --- a/docs/guides/component-testing.mdx +++ b/docs/guides/component-testing.mdx @@ -70,6 +70,19 @@ export const { } ``` +also add the `"jsx": "react-jsx"` compile option to your tsconfig.json: + +```typescript title="tsconfig.json" +{ + "compilerOptions": { + "types": [ + // ... + ], + "jsx": "react-jsx" + } +} +``` + ### Step 4: Write a test 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() { ); } + +export default Component; ``` A fully working examples can be found [here][testplane-examples-component-testing]. diff --git a/i18n/ru/docusaurus-plugin-content-docs/current/guides/component-testing.mdx b/i18n/ru/docusaurus-plugin-content-docs/current/guides/component-testing.mdx index 11cd279..eded2e7 100644 --- a/i18n/ru/docusaurus-plugin-content-docs/current/guides/component-testing.mdx +++ b/i18n/ru/docusaurus-plugin-content-docs/current/guides/component-testing.mdx @@ -66,6 +66,19 @@ export default { }; ``` +также добавьте параметр компиляции `"jsx": "react-jsx"` в ваш файл tsconfig.json: + +```typescript title="tsconfig.json" +{ + "compilerOptions": { + "types": [ + // ... + ], + "jsx": "react-jsx" + } +} +``` + ### Шаг 4: Написание теста Чтобы проверить правильную конфигурацию, мы можем написать самый простой тест, в котором выводим значение document в консоль без использования команды [browser.execute][browser-execute]: @@ -132,6 +145,8 @@ function Component() { ); } + +export default Component; ``` Полностью работающие примеры можно найти [здесь][testplane-examples-component-testing].