From de5c6ce4efc1cbf58fe47d461d696d704b230b12 Mon Sep 17 00:00:00 2001 From: Jason Claxton Date: Thu, 8 Jun 2023 15:37:10 +0100 Subject: [PATCH] Fix issues caused by updating `@hapi/hapi` The upgrade from version 18->19 introduces a breaking change "No joi schema compiler is loaded by default and must be explicitly loaded". This commit fixes that issue as per the v19 release notes: https://github.com/hapijs/hapi/issues/4017 --- index.js | 1 + test/modules/nald-import/nald.test.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index e1fa3a4b..679f498f 100644 --- a/index.js +++ b/index.js @@ -47,6 +47,7 @@ const start = async function () { try { await server.register(plugins) await server.register(HapiPinoPlugin()) + server.validator(require('@hapi/joi')) configureServerAuthStrategy(server) server.route(routes) diff --git a/test/modules/nald-import/nald.test.js b/test/modules/nald-import/nald.test.js index 434b2129..887afca7 100644 --- a/test/modules/nald-import/nald.test.js +++ b/test/modules/nald-import/nald.test.js @@ -11,7 +11,8 @@ let licenceData experiment('Test NALD import', () => { before(async () => { - await server.route(routes) + server.validator(require('@hapi/joi')) + server.route(routes) // Generate dummy NALD data await licenceCreator()