Skip to content

Commit

Permalink
Fix automatic naming with code coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
robertwb authored Mar 4, 2022
1 parent 53aff1b commit 64ee4fb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sdks/typescript/src/apache_beam/transforms/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ export function extractName<T>(withName: T): string {
) {
return untyped.name;
} else {
const stringified = ("" + withName).replace(/s+/, " ");
const stringified = ("" + withName)
// Remove injected code coverage boilerplate.
.replace(/__cov_.*?[+][+]/g, " ")
// Normalize whitespace.
.replace(/\s+/gm, " ")
.trim();
if (stringified.length < 60) {
return stringified;
} else {
Expand Down

0 comments on commit 64ee4fb

Please sign in to comment.