diff --git a/src/features/PesterTests.ts b/src/features/PesterTests.ts index 75bb17698b..34c3a5cc57 100644 --- a/src/features/PesterTests.ts +++ b/src/features/PesterTests.ts @@ -72,6 +72,10 @@ export class PesterTestsFeature implements IFeature { if (describeBlockName) { launchConfig.args.push("-TestName"); + // Escape single quotes inside double quotes by doubling them up + if (describeBlockName.includes("'")) { + describeBlockName = describeBlockName.replace(/'/g, "''"); + } launchConfig.args.push(`'${describeBlockName}'`); }