Fix signature of checkForPortBindingsConflict
This commit is contained in:
@@ -29,26 +29,26 @@ describe('Apps', function () {
|
||||
});
|
||||
|
||||
it('throws on exact conflict', async function () {
|
||||
let [error] = await safe(apps._checkForPortBindingConflict([{ hostPort: 40000, type: 'tcp', portCount: 1 }]));
|
||||
let [error] = await safe(apps._checkForPortBindingConflict([{ hostPort: 40000, type: 'tcp', portCount: 1 }], {}));
|
||||
expect(error.reason).to.equal(BoxError.CONFLICT);
|
||||
|
||||
[error] = await safe(apps._checkForPortBindingConflict([{ hostPort: 50000, type: 'udp', portCount: 1 }]));
|
||||
[error] = await safe(apps._checkForPortBindingConflict([{ hostPort: 50000, type: 'udp', portCount: 1 }], {}));
|
||||
expect(error.reason).to.equal(BoxError.CONFLICT);
|
||||
});
|
||||
|
||||
it('throws on range conflict', async function () {
|
||||
let [error] = await safe(apps._checkForPortBindingConflict([{ hostPort: 40080, type: 'tcp', portCount: 40 }]));
|
||||
let [error] = await safe(apps._checkForPortBindingConflict([{ hostPort: 40080, type: 'tcp', portCount: 40 }], {}));
|
||||
expect(error.reason).to.equal(BoxError.CONFLICT);
|
||||
|
||||
[error] = await safe(apps._checkForPortBindingConflict([{ hostPort: 49995, type: 'udp', portCount: 20 }]));
|
||||
[error] = await safe(apps._checkForPortBindingConflict([{ hostPort: 49995, type: 'udp', portCount: 20 }], {}));
|
||||
expect(error.reason).to.equal(BoxError.CONFLICT);
|
||||
});
|
||||
|
||||
it('succeeds without conflict', async function () {
|
||||
await apps._checkForPortBindingConflict([{ hostPort: 39995, type: 'tcp', portCount: 2 }]);
|
||||
await apps._checkForPortBindingConflict([{ hostPort: 45000, type: 'tcp', portCount: 1 }]);
|
||||
await apps._checkForPortBindingConflict([{ hostPort: 49995, type: 'udp', portCount: 2 }]);
|
||||
await apps._checkForPortBindingConflict([{ hostPort: 50001, type: 'udp', portCount: 1 }]);
|
||||
await apps._checkForPortBindingConflict([{ hostPort: 39995, type: 'tcp', portCount: 2 }], {});
|
||||
await apps._checkForPortBindingConflict([{ hostPort: 45000, type: 'tcp', portCount: 1 }], {});
|
||||
await apps._checkForPortBindingConflict([{ hostPort: 49995, type: 'udp', portCount: 2 }], {});
|
||||
await apps._checkForPortBindingConflict([{ hostPort: 50001, type: 'udp', portCount: 1 }], {});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user