Skip to content

Commit

Permalink
fix(testing): fix jest ci target names
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenPandaz committed Apr 17, 2024
1 parent 45d89d2 commit c0898e6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/jest/src/plugins/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,12 @@ async function buildJestTargets(
// nx-ignore-next-line
})) as typeof import('jest-runtime');

const context = await Runtime.createContext(config.projectConfig, {
const jestContext = await Runtime.createContext(config.projectConfig, {
maxWorkers: 1,
watchman: false,
});

const source = new jest.SearchSource(context);
const source = new jest.SearchSource(jestContext);

const specs = await source.getTestPaths(config.globalConfig);

Expand Down Expand Up @@ -188,7 +188,9 @@ async function buildJestTargets(
targetGroup.push(options.ciTargetName);

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}`;
dependsOn.push(targetName);
targets[targetName] = {
Expand Down

0 comments on commit c0898e6

Please sign in to comment.