Skip to content

Commit

Permalink
WIP(custom-render): passed the custom renderer to the wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
travi committed Dec 17, 2018
1 parent ec1f631 commit 345b4c8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const plugin = {
method: 'GET',
path: '/html',
handler: (request, h) => renderThroughReactRouter(request, h, {
render: options.render,
routes: options.routes,
respond: options.respond,
Root: options.Root,
Expand Down
5 changes: 3 additions & 2 deletions test/unit/route-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ suite('route', () => {
});

test('that the request for html is handled', async () => {
const render = () => undefined;
const route = sinon.stub();
const respond = sinon.spy();
const routes = sinon.spy();
Expand All @@ -32,7 +33,7 @@ suite('route', () => {
const configureStore = sinon.stub();
configureStore.withArgs({session: {auth: auth.credentials}, server}).returns(store);

await plugin.register(server, {respond, routes, Root, configureStore});
await plugin.register(server, {render, respond, routes, Root, configureStore});

assert.calledWith(route, sinon.match({
method: 'GET',
Expand All @@ -41,6 +42,6 @@ suite('route', () => {

route.yieldTo('handler', request, reply);

assert.calledWith(routerWrapper.default, request, reply, {routes, respond, Root, store});
assert.calledWith(routerWrapper.default, request, reply, {render, routes, respond, Root, store});
});
});

0 comments on commit 345b4c8

Please sign in to comment.