Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 15 additions & 0 deletions docs/guides/component-testing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -136,6 +149,8 @@ function Component() {
</div>
);
}

export default Component;
```

A fully working examples can be found [here][testplane-examples-component-testing].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down Expand Up @@ -132,6 +145,8 @@ function Component() {
</div>
);
}

export default Component;
```

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