parent
1d7b118229
commit
4a508d20a4
1 changed files with 17 additions and 1 deletions
|
@ -39,7 +39,23 @@ t.describe('', function() {
|
||||||
let err = await assert.isRejected(core.run())
|
let err = await assert.isRejected(core.run())
|
||||||
assert.strictEqual(err, assertError)
|
assert.strictEqual(err, assertError)
|
||||||
assert.strictEqual(module.start.firstCall[0], core.app.http)
|
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)
|
assert.strictEqual(module.start.firstCall[2], core.app.ctx)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue