Skip to content

Commit 73de8d7

Browse files
committed
test(core): add missing test
1 parent 36d5a81 commit 73de8d7

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

packages/core/test/router/router-execution-context.spec.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,5 +386,30 @@ describe('RouterExecutionContext', () => {
386386
expect(response.redirect.called).to.be.false;
387387
});
388388
});
389+
390+
describe('when replying with result', () => {
391+
it('should call "adapter.reply()" with expected args', async () => {
392+
const result = Promise.resolve('test');
393+
const response = {};
394+
395+
sinon.stub(contextCreator, 'reflectRenderTemplate').returns(undefined);
396+
397+
const handler = contextCreator.createHandleResponseFn(
398+
null,
399+
false,
400+
undefined,
401+
1234,
402+
);
403+
const adapterReplySpy = sinon.spy(adapter, 'reply');
404+
await handler(result, response);
405+
expect(
406+
adapterReplySpy.calledOnceWithExactly(
407+
sinon.match.same(response),
408+
'test',
409+
1234,
410+
),
411+
).to.be.true;
412+
});
413+
});
389414
});
390415
});

0 commit comments

Comments
 (0)