mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
add test for thrown errors when params are missing
This commit is contained in:
parent
ecdde26262
commit
b14efa2f48
1 changed files with 14 additions and 1 deletions
|
@ -144,7 +144,20 @@ define(function (require) {
|
|||
expect(locationUrlSpy.secondCall.args[0]).to.be(testUrl);
|
||||
});
|
||||
|
||||
it('should throw when params are missing');
|
||||
it('should throw when params are missing', function () {
|
||||
var url = '/{replace-me}/{but-not-me}';
|
||||
var params = {
|
||||
'replace-me': 'done'
|
||||
};
|
||||
|
||||
try {
|
||||
kbnUrl.change(url, params);
|
||||
throw new Error('this should not run');
|
||||
} catch (err) {
|
||||
expect(err).to.be.an(Error);
|
||||
expect(err.message).to.match(/but-not-me$/);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe('reload', function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue