metamigo-api: work on making it build

This commit is contained in:
Abel Luck 2023-03-13 14:42:49 +00:00
parent 38e68852d9
commit ef216f7b1c
35 changed files with 407 additions and 322 deletions

View file

@ -1,5 +1,7 @@
import * as Hapi from "@hapi/hapi";
import PgPromisePlugin from ".";
import { makePlugin } from ".";
const plugin = makePlugin();
describe("plugin option validation", () => {
let server;
@ -8,7 +10,7 @@ describe("plugin option validation", () => {
});
it("should throw when no connection details defined", async () => {
expect(server.register(PgPromisePlugin)).rejects.toThrow();
expect(server.register(plugin)).rejects.toThrow();
});
});
@ -20,7 +22,7 @@ describe("basic plugin runtime", () => {
beforeEach(async () => {
server = new Hapi.Server({ port: 0 });
await server.register({
plugin: PgPromisePlugin,
plugin,
options: defaultOpts,
});
await server.start();
@ -63,7 +65,7 @@ describe("plugin runtime", () => {
expect.assertions(5);
await server.register({
plugin: PgPromisePlugin,
plugin,
options: {
...defaultOpts,
logSql: true,