lib: Fix test for the new port parameter support
continuous-integration/appveyor/branch AppVeyor build succeeded Details

master v3.0.0-beta.8
Jonatan Nilsson 2022-03-10 13:40:10 +00:00
parent 1d7b118229
commit 4a508d20a4
1 changed files with 17 additions and 1 deletions

View File

@ -39,7 +39,23 @@ t.describe('', function() {
let err = await assert.isRejected(core.run())
assert.strictEqual(err, assertError)
assert.strictEqual(module.start.firstCall[0], core.app.http)
assert.strictEqual(module.start.firstCall[1], null)
assert.strictEqual(module.start.firstCall[1], 4000)
assert.strictEqual(module.start.firstCall[2], core.app.ctx)
})
t.test('should support overwriting port', async function() {
const assertError = new Error('Inbo')
const assertPort = 9382
module.start.rejects(assertError)
let core = new sc.ServiceCore('testapp', import.meta.url, assertPort)
await core.init(module)
let err = await assert.isRejected(core.run())
assert.strictEqual(err, assertError)
assert.strictEqual(module.start.firstCall[0], core.app.http)
assert.strictEqual(module.start.firstCall[1], assertPort)
assert.strictEqual(module.start.firstCall[2], core.app.ctx)
})