Skip to content

Commit e2541cd

Browse files
authored
Add debug output option for Pester (#2670)
* Add debug output option for Pester * remove space * improve option description
1 parent 4db9e34 commit e2541cd

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

package.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,11 +784,22 @@
784784
"type": "string",
785785
"enum": [
786786
"FromPreference",
787+
"Minimal",
787788
"Normal",
788-
"Minimal"
789+
"Diagnostic"
789790
],
790791
"default": "FromPreference",
791792
"description": "Defines the verbosity of output to be used. For Pester 5 and newer the default value FromPreference, will use the Output settings from the $PesterPreference defined in the caller context, and will default to Normal if there is none. For Pester 4 the FromPreference and Normal options map to All, and Minimal option maps to Fails."
793+
},
794+
"powershell.pester.debugOutputVerbosity": {
795+
"type": "string",
796+
"enum": [
797+
"Minimal",
798+
"Normal",
799+
"Diagnostic"
800+
],
801+
"default": "Diagnostic",
802+
"description": "Defines the verbosity of output to be used when debugging a test or a block. For Pester 5 and newer the default value Diagnostic will print additional information about discovery, skipped and filtered tests, mocking and more."
792803
}
793804
}
794805
},

src/features/PesterTests.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,12 @@ export class PesterTestsFeature implements IFeature {
113113
launchConfig.args.push("-MinimumVersion5");
114114
}
115115

116-
launchConfig.args.push("-Output", `'${settings.pester.outputVerbosity}'`);
116+
if (launchType === LaunchType.Debug) {
117+
launchConfig.args.push("-Output", `'${settings.pester.debugOutputVerbosity}'`);
118+
}
119+
else {
120+
launchConfig.args.push("-Output", `'${settings.pester.outputVerbosity}'`);
121+
}
117122

118123
return launchConfig;
119124
}

src/settings.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ export interface ISideBarSettings {
122122
export interface IPesterSettings {
123123
useLegacyCodeLens?: boolean;
124124
outputVerbosity?: string;
125+
debugOutputVerbosity?: string;
125126
}
126127

127128
export function load(): ISettings {
@@ -194,6 +195,7 @@ export function load(): ISettings {
194195
const defaultPesterSettings: IPesterSettings = {
195196
useLegacyCodeLens: true,
196197
outputVerbosity: "FromPreference",
198+
debugOutputVerbosity: "Diagnostic",
197199
};
198200

199201
return {

0 commit comments

Comments
 (0)