How to configure 'targetDefaults' only for inferred targets created by '@nx/jest/plugin', not all test targets of the workspace? #26852
-
//nx.json
{
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"namedInputs": {
"default": ["{projectRoot}/**/*", "sharedGlobals"],
"sharedGlobals": [],
"jestGlobals": [
"{workspaceRoot}/jest.config.ts",
"{workspaceRoot}/jest.preset.js"
]
},
"plugins": [
{
"plugin": "@nx/jest/plugin",
"options": {
// no other options here
"targetName": "test"
}
}
],
"targetDefaults": {
// this configures all test targets
"test": {
"inputs": ["default", "^default", "jestGlobals"],
"configurations": {
"ci": {
"ci": true,
"coverage": true
}
}
}
}
} A workaround could be to group test targets like 'test-jest', 'test-gradle', 'test-vite' and have a 'test' target which invokes those. Am I missing something? |
Beta Was this translation helpful? Give feedback.
Answered by
RobbyRabbitman
Jul 8, 2024
Replies: 1 comment
-
I solved it by specifying a targetName of 'test-jest' and run in my ci pipeline |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
RobbyRabbitman
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I solved it by specifying a targetName of 'test-jest' and run in my ci pipeline
nx affected -t test test-jest --configuration ci