Skip to content

Commit f20c748

Browse files
oleiadeankur22
authored andcommitted
refactor: consolidate expect.configure description
1 parent d403982 commit f20c748

File tree

1 file changed

+5
-10
lines changed
  • docs/sources/k6/next/javascript-api/jslib/testing

1 file changed

+5
-10
lines changed

docs/sources/k6/next/javascript-api/jslib/testing/configure.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ weight: 20
77

88
# expect.configure()
99

10-
The `expect.configure()` method creates a new configured `expect` instance with custom behavior for the k6 testing library, including timeouts, display options, and soft assertion behavior. The original `expect` instance remains unchanged.
10+
The `expect.configure()` method creates a new configured `expect` instance with custom behavior for the k6 testing library, including timeouts, display options, and soft assertion behavior.
11+
12+
This new instance can be used in place of the default expect function, and will apply the specified configuration to all assertions made with it.
13+
14+
The imported `expect` instance remains unchanged and continues to use the default configuration, allowing different assertion configurations to co-exist within a test.
1115

1216
## Syntax
1317

@@ -37,10 +41,6 @@ const configuredExpect = expect.configure(options)
3741
| --- | --- |
3842
| Expect | A new expect instance with the specified configuration |
3943

40-
## Description
41-
42-
The `expect.configure()` method creates a new expect instance with custom configuration options. This new instance can be used in place of the default expect function, and will apply the specified configuration to all assertions made with it. The original expect instance remains unchanged and continues to use the default configuration.
43-
4444
### Timeout configuration
4545

4646
The `timeout` option controls how long retrying assertions will wait for a condition to become true:
@@ -225,8 +225,3 @@ export default function () {
225225
console.log('Test completed');
226226
}
227227
```
228-
229-
## See Also
230-
231-
- [expect()]({{< relref "./expect" >}}) - Main assertion function
232-
- [Environment Variables]({{< relref "../../../using-k6/environment-variables" >}}) - k6 environment variable usage

0 commit comments

Comments
 (0)