Skip to content

Commit

Permalink
fixed tests and lints
Browse files Browse the repository at this point in the history
  • Loading branch information
eahefnawy committed Sep 18, 2019
1 parent b79c906 commit b5ef8bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 2 additions & 6 deletions lib/classes/CLI.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,17 +329,13 @@ class CLI {
}

getVersionNumber() {
this.consoleLog(
`Framework Core: ${version}\nPlugin: ${enterpriseVersion}\nSDK: ${sdkVersion}`
);
this.consoleLog(`Framework Core: ${version}\nPlugin: ${enterpriseVersion}\nSDK: ${sdkVersion}`);

const userNodeVersion = Number(process.version.split('.')[0].slice(1));
// only show components version if user is running Node 8+
if (userNodeVersion >= 8) {
const { cliVersion, coreVersion } = require('@serverless/cli');
this.consoleLog(
`Components Core: ${coreVersion}\nComponents CLI: ${cliVersion}`
);
this.consoleLog(`Components Core: ${coreVersion}\nComponents CLI: ${cliVersion}`);
}
}

Expand Down
4 changes: 3 additions & 1 deletion lib/classes/CLI.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,10 +447,12 @@ describe('CLI', () => {
it('should log the version numbers', () => {
cli.getVersionNumber();

expect(consoleLogSpy).to.have.been.calledOnce;
expect(consoleLogSpy).to.have.been.called.calledTwice;
expect(consoleLogSpy.args[0][0]).to.include('Framework Core');
expect(consoleLogSpy.args[0][0]).to.include('Plugin');
expect(consoleLogSpy.args[0][0]).to.include('SDK');
expect(consoleLogSpy.args[1][0]).to.include('Components Core');
expect(consoleLogSpy.args[1][0]).to.include('Components CLI');
});
});

Expand Down

0 comments on commit b5ef8bb

Please sign in to comment.