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
Copy file name to clipboardExpand all lines: docs/Configuration.md
+25Lines changed: 25 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -288,6 +288,31 @@ The `extract` function should return an iterable (`Array`, `Set`, etc.) with the
288
288
289
289
That module can also contain a `getCacheKey` function to generate a cache key to determine if the logic has changed and any cached artifacts relying on it should be discarded.
290
290
291
+
### `displayName`[string, object]
292
+
293
+
default: `undefined`
294
+
295
+
Allows for a label to be printed along side a test while it is running. This becomes more useful in multiproject repositories where there can be many jest configuration files. This visually tells which project a test belongs to. Here are sample valid values.
296
+
297
+
```js
298
+
module.exports= {
299
+
displayName:'CLIENT',
300
+
};
301
+
```
302
+
303
+
or
304
+
305
+
```js
306
+
module.exports= {
307
+
displayName: {
308
+
name:'CLIENT',
309
+
color:'blue',
310
+
},
311
+
};
312
+
```
313
+
314
+
As a secondary option, an object with the properties `name` and `color` can be passed. This allows for a custom configuration of the background color of the displayName. `displayName` defaults to white when its value is a string. Jest uses [chalk](https://github.com/chalk/chalk) to provide the color. As such, all of the valid options for colors supported by chalk are also supported by jest.
0 commit comments