You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of the more request features has been the ability to display additional information about a test within the report. As of version 2.0.0 this is now possible. **TODO: Fill in how to do it**
133
+
One of the more request features has been the ability to display additional information about a test within the report. As of version 2.0.0 this is now possible with the `addContext` helper method. This method will add extra information to the test object that will then be displayed inside the report.
134
+
135
+
###addContext(testObj, context)
136
+
137
+
param | type | description
138
+
:---- | :--- | :----------
139
+
testObj | object | The test object
140
+
context | string\|object | The context to be added to the test
141
+
142
+
**Context as a string**
143
+
144
+
Simple strings will be displayed as is. If you pass a URL, the reporter will attempt to turn it into a link. If the URL links to an image, it will be shown inline.
145
+
146
+
**Context as an object**
147
+
148
+
Context passed as an object must adhere to the following shape:
149
+
```js
150
+
{
151
+
title:'some title'// must be a string
152
+
value: {} // can be anything
153
+
}
154
+
```
155
+
156
+
####Example
157
+
*When using the `addContext` helper, you cannot use an arrow function in your `it` statement because your `this` value will not be the test object.*
0 commit comments