fix scenarioManager and getUrl tests
This commit is contained in:
parent
48550f932b
commit
e05e91bcd4
2 changed files with 33 additions and 5 deletions
36
test/fixtures/__tests__/scenarioManager.js
vendored
36
test/fixtures/__tests__/scenarioManager.js
vendored
|
@ -108,12 +108,40 @@ describe('scenario manager', function () {
|
|||
});
|
||||
});
|
||||
|
||||
it('should throw an error if the scenario is not defined', function () {
|
||||
expect(manager.load).withArgs('makelogs').to.throwError();
|
||||
describe('load', function () {
|
||||
it('should reject if the scenario is not specified', function () {
|
||||
return manager.load()
|
||||
.then(function () {
|
||||
throw new Error('Promise should reject')
|
||||
})
|
||||
.catch(function () { return; });
|
||||
});
|
||||
|
||||
it('should reject if the scenario is not defined', function () {
|
||||
return manager.load('idonotexist')
|
||||
.then(function () {
|
||||
throw new Error('Promise should reject')
|
||||
})
|
||||
.catch(function () { return; });
|
||||
});
|
||||
});
|
||||
|
||||
it('should throw an error if an index is not defined when clearing', function () {
|
||||
expect(manager.unload).to.throwError();
|
||||
describe('unload', function () {
|
||||
it('should reject if the scenario is not specified', function () {
|
||||
return manager.unload()
|
||||
.then(function () {
|
||||
throw new Error('Promise should reject')
|
||||
})
|
||||
.catch(function () { return; });
|
||||
});
|
||||
|
||||
it('should reject if the scenario is not defined', function () {
|
||||
return manager.unload('idonotexist')
|
||||
.then(function () {
|
||||
throw new Error('Promise should reject')
|
||||
})
|
||||
.catch(function () { return; });
|
||||
});
|
||||
});
|
||||
|
||||
it('should throw an error if an es server is not specified', function () {
|
||||
|
|
|
@ -10,7 +10,7 @@ describe('getUrl', function () {
|
|||
pathname: 'foo'
|
||||
});
|
||||
|
||||
expect(url).to.be('http://localhost:9220/foo');
|
||||
expect(url).to.be('http://localhost/foo');
|
||||
});
|
||||
|
||||
it('should convert to a secure url with port', function () {
|
||||
|
|
Loading…
Reference in a new issue