Skip to content

Commit

Permalink
chore(misc): update e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo committed Jan 23, 2025
1 parent 99d6a3b commit caa023d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
20 changes: 10 additions & 10 deletions e2e/plugin/src/nx-plugin-ts-solution.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ describe('Nx Plugin (TS solution)', () => {
`generate @nx/plugin:migration packages/${plugin}/src/migrations/update-${migrationVersion}/update-${migrationVersion} --packageVersion=${migrationVersion} --packageJsonUpdates=false`
);

expect(runCLI(`lint ${plugin}`)).toContain(
`Successfully ran target lint for project ${plugin}`
expect(runCLI(`lint @proj/${plugin}`)).toContain(
`Successfully ran target lint for project @proj/${plugin}`
);
expect(runCLI(`typecheck ${plugin}`)).toContain(
`Successfully ran target typecheck for project ${plugin}`
expect(runCLI(`typecheck @proj/${plugin}`)).toContain(
`Successfully ran target typecheck for project @proj/${plugin}`
);
expect(runCLI(`build ${plugin}`)).toContain(
`Successfully ran target build for project ${plugin}`
expect(runCLI(`build @proj/${plugin}`)).toContain(
`Successfully ran target build for project @proj/${plugin}`
);
checkFilesExist(
// entry point
Expand All @@ -71,11 +71,11 @@ describe('Nx Plugin (TS solution)', () => {
`packages/${plugin}/dist/migrations/update-${migrationVersion}/update-${migrationVersion}.js`,
`packages/${plugin}/dist/migrations/update-${migrationVersion}/update-${migrationVersion}.d.ts`
);
expect(runCLI(`test ${plugin}`)).toContain(
`Successfully ran target test for project ${plugin}`
expect(runCLI(`test @proj/${plugin}`)).toContain(
`Successfully ran target test for project @proj/${plugin}`
);
expect(runCLI(`e2e ${plugin}-e2e`)).toContain(
`Successfully ran target e2e for project ${plugin}-e2e`
expect(runCLI(`e2e @proj/${plugin}-e2e`)).toContain(
`Successfully ran target e2e for project @proj/${plugin}-e2e`
);
}, 90000);

Expand Down
2 changes: 1 addition & 1 deletion packages/plugin/src/generators/executor/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ async function normalizeOptions(
propertyName,
description,
projectRoot,
projectSourceRoot,
projectSourceRoot: projectSourceRoot ?? join(projectRoot, 'src'),
isTsSolutionSetup: isUsingTsSolutionSetup(tree),
};
}
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin/src/generators/generator/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ async function normalizeOptions(
propertyName,
description,
projectRoot,
projectSourceRoot,
projectSourceRoot: projectSourceRoot ?? join(projectRoot, 'src'),
isTsSolutionSetup: isUsingTsSolutionSetup(tree),
};
}
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin/src/generators/migration/migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ async function normalizeOptions(
name,
description,
projectRoot,
projectSourceRoot,
projectSourceRoot: projectSourceRoot ?? join(projectRoot, 'src'),
isTsSolutionSetup: isUsingTsSolutionSetup(tree),
};

Expand Down
3 changes: 2 additions & 1 deletion packages/plugin/src/generators/plugin/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ function updatePluginConfig(host: Tree, options: NormalizedSchema) {

if (project.targets.build) {
if (options.isTsSolutionSetup && options.bundler === 'tsc') {
project.targets.build.options.rootDir = project.sourceRoot;
project.targets.build.options.rootDir =
project.sourceRoot ?? joinPathFragments(project.root, 'src');
project.targets.build.options.generatePackageJson = false;
}

Expand Down

0 comments on commit caa023d

Please sign in to comment.