fix(testing): fix jest ci target names (#22858)
This commit is contained in:
parent
7ebd27af02
commit
25f598ffbe
@ -153,12 +153,12 @@ async function buildJestTargets(
|
|||||||
// nx-ignore-next-line
|
// nx-ignore-next-line
|
||||||
})) as typeof import('jest-runtime');
|
})) as typeof import('jest-runtime');
|
||||||
|
|
||||||
const context = await Runtime.createContext(config.projectConfig, {
|
const jestContext = await Runtime.createContext(config.projectConfig, {
|
||||||
maxWorkers: 1,
|
maxWorkers: 1,
|
||||||
watchman: false,
|
watchman: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
const source = new jest.SearchSource(context);
|
const source = new jest.SearchSource(jestContext);
|
||||||
|
|
||||||
const specs = await source.getTestPaths(config.globalConfig);
|
const specs = await source.getTestPaths(config.globalConfig);
|
||||||
|
|
||||||
@ -188,7 +188,9 @@ async function buildJestTargets(
|
|||||||
targetGroup.push(options.ciTargetName);
|
targetGroup.push(options.ciTargetName);
|
||||||
|
|
||||||
for (const testPath of testPaths) {
|
for (const testPath of testPaths) {
|
||||||
const relativePath = normalize(relative(projectRoot, testPath));
|
const relativePath = normalize(
|
||||||
|
relative(join(context.workspaceRoot, projectRoot), testPath)
|
||||||
|
);
|
||||||
const targetName = `${options.ciTargetName}--${relativePath}`;
|
const targetName = `${options.ciTargetName}--${relativePath}`;
|
||||||
dependsOn.push(targetName);
|
dependsOn.push(targetName);
|
||||||
targets[targetName] = {
|
targets[targetName] = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user