From 0dd74a93bfcd4c094de4f1305bab5fbace24fff0 Mon Sep 17 00:00:00 2001 From: Val Lorentz Date: Fri, 17 Mar 2023 17:10:19 +0100 Subject: [PATCH] tests/server: Tear down test fixtures in the order they were setup if for whatever reason before() fails to import the server, it causes after() to fail on the first line, so it doesn't restore stubs; causing other errors to be printed in other tests ("TypeError: Attempted to wrap warn which is already wrapped") --- test/server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/server.ts b/test/server.ts index 571a6bcc..ad172b77 100644 --- a/test/server.ts +++ b/test/server.ts @@ -39,10 +39,10 @@ describe("Server", function () { }); after(function (done) { - server.close(done); logInfoStub.restore(); logWarnStub.restore(); checkForUpdatesStub.restore(); + server.close(done); }); // eslint-disable-next-line @typescript-eslint/restrict-template-expressions