MaxScale/maxctrl/test/unknown.js
Markus Mäkelä 163b3a2da5
Fix unhandled promise rejection in create monitor
If a monitor was created with an argument that was not a key-value type, a
promise would be rejected outside of the main maxctrl function. Added a
test case that covers this and fixed a few other test coverage problems
that were present.
2019-04-17 11:17:33 +03:00

40 lines
765 B
JavaScript

require('../test_utils.js')()
describe("Unknown Commands", function() {
before(startMaxScale)
var endpoints = [
'list',
'show',
'set',
'clear',
'enable',
'disable',
'create',
'destroy',
'link',
'unlink',
'start',
'stop',
'alter',
'rotate',
'call',
'cluster',
'drain'
]
endpoints.forEach(function (i) {
it('unknown ' + i + ' command', function() {
return doCommand(i + ' something')
.should.be.rejected
})
})
it('generic unknown command', function() {
return doCommand('something')
.should.be.rejected
})
after(stopMaxScale)
});