Skip to content
Closed
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 @@ -203,7 +203,7 @@ function logSummary(
if (migratedProjects.length > 0) {
context.logger.info(
`\nNote: To refactor your test files from Jasmine to Vitest, consider running the following command:` +
`\n ng g @schematics/angular:refactor-jasmine-vitest <project_name>`,
`\n ng g @schematics/angular:refactor-jasmine-vitest --project <project_name>`,
);
}
context.logger.info('-----------------------------------------\n');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,23 @@ describe('Migration from Karma to Vitest unit-test builder', () => {
expect(projects.app.targets.test.options.karmaConfig).toBeUndefined();
});

it('should suggest a valid command to refactor Jasmine tests', async () => {
const logs: string[] = [];
const loggerSubscription = schematicRunner.logger.subscribe(({ message }) =>
logs.push(message),
);

try {
await schematicRunner.runSchematic('migrate-karma-to-vitest', {}, tree);
} finally {
loggerSubscription.unsubscribe();
}

expect(logs.join('\n')).toContain(
'ng g @schematics/angular:refactor-jasmine-vitest --project <project_name>',
);
});

it('should map codeCoverage to coverage', async () => {
const { projects } = tree.readJson('/angular.json') as any;
projects.app.targets.test.options.codeCoverage = true;
Expand Down
Loading