From ec75ff00cb8fdcef1857749ce6d033860e1ca157 Mon Sep 17 00:00:00 2001 From: Reto Brunner Date: Wed, 26 Jul 2023 21:25:21 +0200 Subject: [PATCH] sqlite: don't modify global array during tests --- test/plugins/sqlite.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/plugins/sqlite.ts b/test/plugins/sqlite.ts index 1ce745cd..400d3c9a 100644 --- a/test/plugins/sqlite.ts +++ b/test/plugins/sqlite.ts @@ -111,7 +111,7 @@ describe("SQLite migrations", function () { it("has working down-migrations", async function () { await serialize_run("BEGIN EXCLUSIVE TRANSACTION"); - for (const rollback of rollbacks.reverse()) { + for (const rollback of rollbacks.slice().reverse()) { if (rollback.rollback_forbidden) { throw Error( "Try to write a down migration, if you really can't, flip this to a break" @@ -356,7 +356,7 @@ describe("SQLite Message Storage", function () { }); it("should be able to downgrade", async function () { - for (const rollback of rollbacks.reverse()) { + for (const rollback of rollbacks.slice().reverse()) { if (rollback.rollback_forbidden) { throw Error( "Try to write a down migration, if you really can't, flip this to a break"