mirror of
https://github.com/serverless/serverless.git
synced 2025-12-08 19:46:03 +00:00
30 lines
1.0 KiB
JavaScript
30 lines
1.0 KiB
JavaScript
'use strict';
|
|
|
|
const expect = require('chai').expect;
|
|
const getCommandSuggestion = require('./getCommandSuggestion');
|
|
const Serverless = require('../../lib/Serverless');
|
|
|
|
describe('#getCommandSuggestion', () => {
|
|
let serverless;
|
|
|
|
before(() => {
|
|
serverless = new Serverless();
|
|
return serverless.init();
|
|
});
|
|
|
|
it('should return "package" as a suggested command if you input "pekage"', () => {
|
|
const suggestedCommand = getCommandSuggestion('pekage', serverless.cli.loadedCommands);
|
|
expect(suggestedCommand).to.be.equal('package');
|
|
});
|
|
|
|
it('should return "deploy" as a suggested command if you input "deploi"', () => {
|
|
const suggestedCommand = getCommandSuggestion('deploi', serverless.cli.loadedCommands);
|
|
expect(suggestedCommand).to.be.equal('deploy');
|
|
});
|
|
|
|
it('should return "invoke" as a suggested command if you input "lnvoke"', () => {
|
|
const suggestedCommand = getCommandSuggestion('lnvoke', serverless.cli.loadedCommands);
|
|
expect(suggestedCommand).to.be.equal('invoke');
|
|
});
|
|
});
|