Skip to content

Commit 29a23cc

Browse files
D4N14Liclanton
authored andcommitted
Update test
1 parent 7239e43 commit 29a23cc

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

libraries/ts-command-line/src/test/ScopedCommandLineAction.test.ts

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import type { CommandLineFlagParameter } from '../parameters/CommandLineFlagPara
1212
class TestScopedAction extends ScopedCommandLineAction {
1313
public done: boolean = false;
1414
public scopedValue: string | undefined;
15-
private _verboseArg!: CommandLineFlagParameter;
16-
private _scopeArg!: CommandLineStringParameter;
15+
private _verboseArg: CommandLineFlagParameter;
16+
private _scopeArg: CommandLineStringParameter;
1717
private _scopedArg: CommandLineStringParameter | undefined;
1818

1919
public constructor() {
@@ -22,17 +22,7 @@ class TestScopedAction extends ScopedCommandLineAction {
2222
summary: 'does the scoped action',
2323
documentation: 'a longer description'
2424
});
25-
}
26-
27-
protected async onExecute(): Promise<void> {
28-
if (this._scopedArg) {
29-
expect(this._scopedArg.longName).toBe(`--scoped-${this._scopeArg.value}`);
30-
this.scopedValue = this._scopedArg.value;
31-
}
32-
this.done = true;
33-
}
3425

35-
protected onDefineUnscopedParameters(): void {
3626
this._verboseArg = this.defineFlagParameter({
3727
parameterLongName: '--verbose',
3828
description: 'A flag parameter.'
@@ -46,6 +36,14 @@ class TestScopedAction extends ScopedCommandLineAction {
4636
});
4737
}
4838

39+
protected async onExecute(): Promise<void> {
40+
if (this._scopedArg) {
41+
expect(this._scopedArg.longName).toBe(`--scoped-${this._scopeArg.value}`);
42+
this.scopedValue = this._scopedArg.value;
43+
}
44+
this.done = true;
45+
}
46+
4947
protected onDefineScopedParameters(scopedParameterProvider: CommandLineParameterProvider): void {
5048
if (this._scopeArg.value) {
5149
this._scopedArg = scopedParameterProvider.defineStringParameter({

0 commit comments

Comments
 (0)