From 4584f7621a0a2b91f9a91d8a7f418c4882f69848 Mon Sep 17 00:00:00 2001 From: William Killerud Date: Fri, 15 Nov 2024 15:16:04 +0100 Subject: [PATCH] test: run tests in sequence --- package.json | 8 ++++---- test/alias.test.mjs | 4 ++-- test/integration/alias-legacy.test.mjs | 4 ++-- test/integration/alias.test.mjs | 6 +++--- test/integration/integrity.test.mjs | 4 ++-- test/integration/login.test.mjs | 4 ++-- test/integration/map.test.mjs | 4 ++-- test/integration/meta.test.mjs | 4 ++-- test/integration/package.test.mjs | 4 ++-- test/integration/version.test.mjs | 4 ++-- test/integrity.test.mjs | 4 ++-- test/login.test.mjs | 4 ++-- test/meta.test.mjs | 4 ++-- test/publish-files-definitions.test.mjs | 4 ++-- test/publish.map.test.mjs | 4 ++-- test/publish.package.test.mjs | 4 ++-- test/version.test.mjs | 4 ++-- 17 files changed, 37 insertions(+), 37 deletions(-) diff --git a/package.json b/package.json index 5318b186..57148003 100644 --- a/package.json +++ b/package.json @@ -24,10 +24,10 @@ ], "scripts": { "clean": "rimraf .tap node_modules types", - "test": "cross-env HTTP_PORT=0 LOG_LEVEL=fatal tap --timeout 60 --disable-coverage", - "test:integration": "cross-env HTTP_PORT=0 LOG_LEVEL=fatal tap --timeout 60 --disable-coverage test/integration/**/*.test.mjs", - "test:unit": "cross-env HTTP_PORT=0 LOG_LEVEL=fatal tap --timeout 60 --disable-coverage test/*.test.mjs", - "test:tasks": "cross-env HTTP_PORT=0 LOG_LEVEL=fatal tap --timeout 60 --disable-coverage test/tasks/*.test.mjs", + "test": "cross-env HTTP_PORT=0 LOG_LEVEL=fatal tap --timeout 60 --disable-coverage --jobs=0", + "test:integration": "cross-env HTTP_PORT=0 LOG_LEVEL=fatal tap --timeout 60 --disable-coverage --jobs=0 test/integration/**/*.test.mjs", + "test:unit": "cross-env HTTP_PORT=0 LOG_LEVEL=fatal tap --timeout 60 --disable-coverage --jobs=0 test/*.test.mjs", + "test:tasks": "cross-env HTTP_PORT=0 LOG_LEVEL=fatal tap --timeout 60 --disable-coverage --jobs=0 test/tasks/*.test.mjs", "lint": "eslint .", "lint:fix": "eslint --fix .", "format:check": "prettier -c .", diff --git a/test/alias.test.mjs b/test/alias.test.mjs index c443764e..85ccf5b9 100644 --- a/test/alias.test.mjs +++ b/test/alias.test.mjs @@ -14,10 +14,10 @@ const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); beforeEach(async (t) => { - const server = fastify({ logger: false }); + const server = fastify(); const memSink = new Sink(); const service = new EikService({ customSink: memSink }); - server.register(service.api()); + await server.register(service.api()); const address = await server.listen({ host: "127.0.0.1", port: 0, diff --git a/test/integration/alias-legacy.test.mjs b/test/integration/alias-legacy.test.mjs index 90fecd77..ec9ab864 100644 --- a/test/integration/alias-legacy.test.mjs +++ b/test/integration/alias-legacy.test.mjs @@ -22,10 +22,10 @@ function exec(cmd) { } beforeEach(async (t) => { - const server = fastify({ logger: false }); + const server = fastify(); const memSink = new Sink(); const service = new EikService({ customSink: memSink }); - server.register(service.api()); + await server.register(service.api()); const address = await server.listen({ host: "127.0.0.1", port: 0, diff --git a/test/integration/alias.test.mjs b/test/integration/alias.test.mjs index 67766db6..196ed70f 100644 --- a/test/integration/alias.test.mjs +++ b/test/integration/alias.test.mjs @@ -1,6 +1,6 @@ import fastify from "fastify"; import { promises as fs } from "node:fs"; -import os, { type } from "node:os"; +import os from "node:os"; import { exec as execCallback } from "child_process"; import { join, basename } from "node:path"; import { test, beforeEach, afterEach } from "tap"; @@ -22,10 +22,10 @@ function exec(cmd) { } beforeEach(async (t) => { - const server = fastify({ logger: false }); + const server = fastify(); const memSink = new Sink(); const service = new EikService({ customSink: memSink }); - server.register(service.api()); + await server.register(service.api()); const address = await server.listen({ host: "127.0.0.1", port: 0, diff --git a/test/integration/integrity.test.mjs b/test/integration/integrity.test.mjs index cea8d894..f38a7f46 100644 --- a/test/integration/integrity.test.mjs +++ b/test/integration/integrity.test.mjs @@ -23,9 +23,9 @@ function exec(cmd) { beforeEach(async (t) => { const memSink = new Sink(); - const server = fastify({ logger: false }); + const server = fastify(); const service = new EikService({ customSink: memSink }); - server.register(service.api()); + await server.register(service.api()); const address = await server.listen({ host: "127.0.0.1", port: 0, diff --git a/test/integration/login.test.mjs b/test/integration/login.test.mjs index 6610f8fa..e46b41fe 100644 --- a/test/integration/login.test.mjs +++ b/test/integration/login.test.mjs @@ -22,9 +22,9 @@ function exec(cmd) { beforeEach(async (t) => { const memSink = new Sink(); - const server = fastify({ logger: false }); + const server = fastify(); const service = new EikService({ customSink: memSink }); - server.register(service.api()); + await server.register(service.api()); const address = await server.listen({ host: "127.0.0.1", port: 0, diff --git a/test/integration/map.test.mjs b/test/integration/map.test.mjs index dda48d60..d31d2592 100644 --- a/test/integration/map.test.mjs +++ b/test/integration/map.test.mjs @@ -23,9 +23,9 @@ function exec(cmd) { beforeEach(async (t) => { const memSink = new Sink(); - const server = fastify({ logger: false }); + const server = fastify(); const service = new EikService({ customSink: memSink }); - server.register(service.api()); + await server.register(service.api()); const address = await server.listen({ host: "127.0.0.1", port: 0, diff --git a/test/integration/meta.test.mjs b/test/integration/meta.test.mjs index abc72002..ed6335ff 100644 --- a/test/integration/meta.test.mjs +++ b/test/integration/meta.test.mjs @@ -23,9 +23,9 @@ function exec(cmd) { beforeEach(async (t) => { const memSink = new Sink(); - const server = fastify({ logger: false }); + const server = fastify(); const service = new EikService({ customSink: memSink }); - server.register(service.api()); + await server.register(service.api()); const address = await server.listen({ host: "127.0.0.1", port: 0, diff --git a/test/integration/package.test.mjs b/test/integration/package.test.mjs index aed69fda..8bd3dc29 100644 --- a/test/integration/package.test.mjs +++ b/test/integration/package.test.mjs @@ -23,9 +23,9 @@ function exec(cmd) { beforeEach(async (t) => { const memSink = new Sink(); - const server = fastify({ logger: false }); + const server = fastify(); const service = new EikService({ customSink: memSink }); - server.register(service.api()); + await server.register(service.api()); const address = await server.listen({ host: "127.0.0.1", port: 0, diff --git a/test/integration/version.test.mjs b/test/integration/version.test.mjs index 9af4e892..961d7c58 100644 --- a/test/integration/version.test.mjs +++ b/test/integration/version.test.mjs @@ -29,9 +29,9 @@ function exec(cmd, opts = {}) { beforeEach(async (t) => { const memSink = new Sink(); - const server = fastify({ logger: false }); + const server = fastify(); const service = new EikService({ customSink: memSink }); - server.register(service.api()); + await server.register(service.api()); const address = await server.listen({ host: "127.0.0.1", port: 0, diff --git a/test/integrity.test.mjs b/test/integrity.test.mjs index fda02840..079a754e 100644 --- a/test/integrity.test.mjs +++ b/test/integrity.test.mjs @@ -14,10 +14,10 @@ const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); beforeEach(async (t) => { - const server = fastify({ logger: false }); + const server = fastify(); const memSink = new Sink(); const service = new EikService({ customSink: memSink }); - server.register(service.api()); + await server.register(service.api()); const address = await server.listen({ host: "127.0.0.1", port: 0, diff --git a/test/login.test.mjs b/test/login.test.mjs index 67641462..d0a4354e 100644 --- a/test/login.test.mjs +++ b/test/login.test.mjs @@ -15,9 +15,9 @@ const __dirname = dirname(__filename); beforeEach(async (t) => { const memSink = new Sink(); - const server = fastify({ logger: false }); + const server = fastify(); const service = new EikService({ customSink: memSink }); - server.register(service.api()); + await server.register(service.api()); const address = await server.listen({ host: "127.0.0.1", port: 0, diff --git a/test/meta.test.mjs b/test/meta.test.mjs index e336a7b5..780f102f 100644 --- a/test/meta.test.mjs +++ b/test/meta.test.mjs @@ -14,10 +14,10 @@ const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); beforeEach(async (t) => { - const server = fastify({ logger: false }); + const server = fastify(); const memSink = new Sink(); const service = new EikService({ customSink: memSink }); - server.register(service.api()); + await server.register(service.api()); const address = await server.listen({ host: "127.0.0.1", port: 0, diff --git a/test/publish-files-definitions.test.mjs b/test/publish-files-definitions.test.mjs index ebedc0a6..fb05ea6a 100644 --- a/test/publish-files-definitions.test.mjs +++ b/test/publish-files-definitions.test.mjs @@ -26,9 +26,9 @@ const config = (files, server, token, cwd) => ({ beforeEach(async (t) => { const memSink = new Sink(); - const server = fastify({ logger: false }); + const server = fastify(); const service = new EikService({ customSink: memSink }); - server.register(service.api()); + await server.register(service.api()); const address = await server.listen({ host: "127.0.0.1", port: 0, diff --git a/test/publish.map.test.mjs b/test/publish.map.test.mjs index 2818b78f..d952dfb5 100644 --- a/test/publish.map.test.mjs +++ b/test/publish.map.test.mjs @@ -15,9 +15,9 @@ const __dirname = dirname(__filename); beforeEach(async (t) => { const memSink = new Sink(); - const server = fastify({ logger: false }); + const server = fastify(); const service = new EikService({ customSink: memSink }); - server.register(service.api()); + await server.register(service.api()); const address = await server.listen({ host: "127.0.0.1", port: 0, diff --git a/test/publish.package.test.mjs b/test/publish.package.test.mjs index 91bdd974..84dfafce 100644 --- a/test/publish.package.test.mjs +++ b/test/publish.package.test.mjs @@ -15,9 +15,9 @@ const __dirname = dirname(__filename); beforeEach(async (t) => { const memSink = new Sink(); - const server = fastify({ logger: false }); + const server = fastify(); const service = new EikService({ customSink: memSink }); - server.register(service.api()); + await server.register(service.api()); const address = await server.listen({ host: "127.0.0.1", port: 0, diff --git a/test/version.test.mjs b/test/version.test.mjs index 1b078564..0e831136 100644 --- a/test/version.test.mjs +++ b/test/version.test.mjs @@ -14,9 +14,9 @@ const __dirname = dirname(__filename); beforeEach(async (t) => { const memSink = new Sink(); - const server = fastify({ logger: false }); + const server = fastify(); const service = new EikService({ customSink: memSink }); - server.register(service.api()); + await server.register(service.api()); const address = await server.listen({ host: "127.0.0.1", port: 0,