Skip to content

Commit

Permalink
Fix @hapi/hapi breaking tests about form-multipart refused by default
Browse files Browse the repository at this point in the history
See hapijs/hapi#4017 section "Change route options.payload.multipart to false by default"
  • Loading branch information
jbuget committed May 22, 2020
1 parent ace6440 commit 1699a10
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions api/lib/application/sessions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ exports.register = async (server) => {
}),
},
payload: {
multipart: true,
allow: 'multipart/form-data',
maxBytes: 1048576 * 10, // 10MB
},
Expand Down
2 changes: 1 addition & 1 deletion api/tests/unit/application/session/index_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ describe('Unit | Application | Sessions | Routes', () => {
let server;

beforeEach(() => {
server = this.server = Hapi.server();
sinon.stub(sessionAuthorization, 'verify').returns(null);
sinon.stub(securityPreHandlers, 'checkUserHasRolePixMaster').callsFake((request, h) => h.response(true));

Expand All @@ -33,6 +32,7 @@ describe('Unit | Application | Sessions | Routes', () => {
sinon.stub(sessionController, 'flagResultsAsSentToPrescriber').returns('ok');
sinon.stub(sessionController, 'assignCertificationOfficer').returns('ok');

server = this.server = Hapi.server();
return server.register(route);
});

Expand Down

0 comments on commit 1699a10

Please sign in to comment.