Skip to content

Commit

Permalink
fix(bod-BaseCommand): add getName method
Browse files Browse the repository at this point in the history
issue #15
  • Loading branch information
sabertazimi committed Aug 14, 2021
1 parent e00613b commit 00f29a2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/bod/lib/commands/BaseCommand.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ const options = {
};

describe('BaseCommand', () => {
test('should have [name] field', () => {
const baseCommand = new BaseCommand(options);
expect(baseCommand.getName()).toBe(options.name);
});

test('should have [description] field', () => {
const baseCommand = new BaseCommand(options);
expect(baseCommand.getDescription()).toBe(options.description);
Expand Down
4 changes: 4 additions & 0 deletions packages/bod/lib/commands/BaseCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ class BaseCommand {
this.usage = usage;
}

public getName(): string {
return this.name;
}

public getDescription(): string {
return this.description;
}
Expand Down

0 comments on commit 00f29a2

Please sign in to comment.