fixed tests and lints

This commit is contained in:
Eslam A. Hefnawy 2019-09-18 15:29:30 +03:00
parent b79c9060ea
commit b5ef8bb9cd
2 changed files with 5 additions and 7 deletions

View File

@ -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}`);
}
}

View File

@ -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');
});
});