Skip to content
This repository was archived by the owner on Dec 8, 2022. It is now read-only.

Commit 092330d

Browse files
author
Bobby Earl
authored
Having runCommand return a boolean (#277)
* Having runCommand return a boolean * Fixed test description
1 parent 1ac72c7 commit 092330d

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

index.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ module.exports = {
4646
require('./cli/version')();
4747
break;
4848
default:
49-
logger.info('@blackbaud/skyux-builder: Unknown command %s', command);
50-
break;
49+
return false;
5150
}
51+
52+
return true;
5253
}
5354
};

test/index.spec.js

+9-6
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,18 @@ describe('@blackbaud/skyux-builder', () => {
5757
});
5858
});
5959

60-
it('should handle unknown command', () => {
60+
it('should return false for unknown command', () => {
6161
spyOn(logger, 'info');
6262
const cmd = 'junk-command-that-does-not-exist';
6363
const lib = require('../index');
64-
lib.runCommand(cmd, {});
65-
expect(logger.info).toHaveBeenCalledWith(
66-
'@blackbaud/skyux-builder: Unknown command %s',
67-
cmd
68-
);
64+
expect(lib.runCommand(cmd, {})).toBe(false);
65+
});
66+
67+
it('should return true for known command', () => {
68+
spyOn(logger, 'info');
69+
const cmd = 'version';
70+
const lib = require('../index');
71+
expect(lib.runCommand(cmd, {})).toBe(true);
6972
});
7073

7174
it('should process shorthand tags', (done) => {

0 commit comments

Comments
 (0)