Skip to content

fix(@angular-devkit/build-angular): fix incorrect glob cwd in karma when using --include option #23401

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,8 @@ export function execute(
}

const projectMetadata = await context.getProjectMetadata(projectName);
const projectRoot = path.join(
context.workspaceRoot,
(projectMetadata.root as string | undefined) ?? '',
);
const projectSourceRoot = path.join(
projectRoot,
(projectMetadata.sourceRoot as string | undefined) ?? '',
);
const sourceRoot = (projectMetadata.sourceRoot ?? projectMetadata.root ?? '') as string;
const projectSourceRoot = path.join(context.workspaceRoot, sourceRoot);

const files = await findTests(options.include, context.workspaceRoot, projectSourceRoot);
// early exit, no reason to start karma
Expand Down
5 changes: 5 additions & 0 deletions tests/legacy-cli/e2e/tests/test/test-include-glob.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { ng } from '../../utils/process';

export default async function () {
await ng('test', '--no-watch', `--include='**/*.spec.ts'`);
}