Skip to content

Commit

Permalink
feat(core): add option ciGroupName to allow customizing the name of…
Browse files Browse the repository at this point in the history
… `Jest` atomized taks group on CI

Closes nrwl#28066
  • Loading branch information
tinesoft committed Dec 17, 2024
1 parent ee4de0b commit 367b046
Show file tree
Hide file tree
Showing 4 changed files with 739 additions and 223 deletions.
23 changes: 23 additions & 0 deletions docs/generated/packages/jest/documents/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,29 @@ target with that name which can be used in CI to run the tests for each file in
}
```

### Customizing atomized unit/e2e tasks group name

By default, atomized tasks group name is derived from the `ciTargetName`. For example, atomized tasks for `e2e-ci` target, will be grouped under the name "E2E (CI) when displayed in Nx Cloud or `nx show project <project> --web` UI.
You can customize that name, by explicitly providing the optional `ciGroupName` in the plugin option, as such:

```json {% fileName="nx.json" %}
{
"plugins": [
{
"plugin": "@nx/jest/plugin",
"include": ["e2e/**/*"],
"options": {
"targetName": "e2e-local",
"ciTargetName": "e2e-ci"
"ciGroupname": "My E2E tests (CI)
}
}
]
}
```

if you don't provide that option, the plugin will try to deduct the group name as described above, and will fallback to "E2E (CI)" if it can't.

### How @nx/jest Infers Tasks

{% callout type="note" title="Inferred Tasks" %}
Expand Down
23 changes: 23 additions & 0 deletions docs/shared/packages/jest/jest-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,29 @@ target with that name which can be used in CI to run the tests for each file in
}
```

### Customizing atomized unit/e2e tasks group name

By default, atomized tasks group name is derived from the `ciTargetName`. For example, atomized tasks for `e2e-ci` target, will be grouped under the name "E2E (CI) when displayed in Nx Cloud or `nx show project <project> --web` UI.
You can customize that name, by explicitly providing the optional `ciGroupName` in the plugin option, as such:

```json {% fileName="nx.json" %}
{
"plugins": [
{
"plugin": "@nx/jest/plugin",
"include": ["e2e/**/*"],
"options": {
"targetName": "e2e-local",
"ciTargetName": "e2e-ci"
"ciGroupname": "My E2E tests (CI)
}
}
]
}
```

if you don't provide that option, the plugin will try to deduct the group name as described above, and will fallback to "E2E (CI)" if it can't.

### How @nx/jest Infers Tasks

{% callout type="note" title="Inferred Tasks" %}
Expand Down
Loading

0 comments on commit 367b046

Please sign in to comment.