test(admin): pass hook timeout as before() arg, not vi.setConfig

vi.setConfig({hookTimeout: N}) inside a before() callback is a no-op —
vitest reads hook timeouts before the hook runs. padLoadFilter genuinely
needs 120s for its setup, so pass it as the second arg. The two 60s
files drop the override entirely (matches the global default already
set in vitest.config.ts).
This commit is contained in:
SamTV12345 2026-05-25 12:04:30 +02:00
parent d8eeee8321
commit 934ec7b960
3 changed files with 1 additions and 7 deletions

View file

@ -1,7 +1,6 @@
'use strict';
import {strict as assert} from 'assert';
import {vi} from 'vitest';
import setCookieParser from 'set-cookie-parser';
import * as fs from 'fs';
import * as os from 'os';
@ -96,7 +95,6 @@ describe(__filename, () => {
let skipReason: string | null = null;
before(async () => {
vi.setConfig({hookTimeout: 60000});
await common.init();
// The load handler bails with logger.error + early return if the

View file

@ -1,7 +1,6 @@
'use strict';
import {strict as assert} from 'assert';
import {vi} from 'vitest';
import setCookieParser from 'set-cookie-parser';
import * as fs from 'fs';
import * as os from 'os';
@ -109,7 +108,6 @@ describe(__filename, () => {
let skipReason: string | null = null;
before(async () => {
vi.setConfig({hookTimeout: 60000});
await common.init();
savedSettingsFilename = settings.settingsFilename;

View file

@ -9,7 +9,6 @@
// offset/limit slice, so `total` reflects the filtered universe.
import {strict as assert} from 'assert';
import {vi} from 'vitest';
import setCookieParser from 'set-cookie-parser';
const io = require('socket.io-client');
@ -100,7 +99,6 @@ describe(__filename, () => {
const editedPadIds: string[] = [];
before(async () => {
vi.setConfig({hookTimeout: 120000});
await common.init();
savedUsers = settings.users;
@ -132,7 +130,7 @@ describe(__filename, () => {
await pad.setText(`seed-${i}\n`, `m-${tag}-${i}`);
editedPadIds.push(id);
}
});
}, 120000);
after(async () => {
if (socket) socket.disconnect();