Closed fiatjaf closed 8 years ago
There was no test for the previous autocomplete behavior, and I don't know how to test it.
Oh shoot - yeah I remember testing auto-completion was tricky. Okay, fine for now. Thanks!
came up with this:
describe('command execution', function () {
vorpal.ui.input('donal');
vorpal.ui._activePrompt.screen.rl.cursor = 5;
vorpal.ui.emit('vorpal_ui_keypress', {key: 'tab'});
vorpal.ui.input().should.equal('donald trump ');
});
but session.getAutocomplete
's trimmed
variable comes up as undefined
and so no match is found. Where is the error? What is the correct way to set this cursor?
Awesome - thanks! Would you be able to throw in test coverage for this?