SPB Git

Repository Public

vitest.config.ts 3.1 KB 86 lines typescript

1/**2 * =============================================================================3 *                  SP BOUCHER | SOFTWARE & RESEARCH4 *             ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5 * =============================================================================6 *7 * Project          : UQO Éval — Le Grand Défi Immobilier8 * File             : vitest.config.ts9 * Repository       : https://git.spboucher.ai/uqo-eval-jeux10 * Project Website  : https://jeux.uqo-eval.app11 * Created          : 2026-11-2512 * Last Modified    : 2026-11-2513 *14 * Author           : Simon-Pierre Boucher15 * Position         : Professor of Finance16 * Institution      : Université du Québec en Outaouais (UQO)17 * Organization     : SP Boucher18 * Website          : https://spboucher.ai19 * Git              : https://git.spboucher.ai20 *21 * Preferred Contact: contact@spboucher.ai22 * Development      : dev@spboucher.ai23 * Support          : support@spboucher.ai24 * Security/Admin   : admin@spboucher.ai25 *26 * Copyright (c) 202627 * Simon-Pierre Boucher28 * All rights reserved where applicable. This file is governed by the29 * applicable project license, copyright notices and relevant law.30 * Existing third-party rights and notices remain unaffected.31 *32 * License          : None specified (no license file in this repository)33 *34 * Do not embed credentials, private keys, access tokens,35 * certificates or confidential personal information.36 *37 * =============================================================================38 * END OF SP BOUCHER SOURCE HEADER39 * =============================================================================40 */4142import os from "node:os";43import path from "node:path";44import { defineConfig } from "vitest/config";4546/**47 * Suite de tests — UQO ÉVAL · Le Grand Défi Immobilier.48 *49 * Les variables d'environnement sont fixées ici, avant tout import de l'API50 * (config.ts les lit à l'import). La base de test est réservée aux tests :51 * jamais `uqo_jeux_dev`.52 */53export const TEST_ENV = {54  NODE_ENV: "test",55  DATABASE_URL: "postgres://localhost/uqo_jeux_test",56  DATABASE_POOL: "12",57  SESSION_SECRET: "secret-de-test-ne-sert-qu-aux-tests",58  ADMIN_KEY: "cle-admin-de-test",59  LISTINGS_DB_PATH: path.resolve(import.meta.dirname, "data/dev/listings.db"),60  IMAGE_STORAGE_PATH: path.join(os.tmpdir(), "uqo-jeux-test-images"),61  // Aucun accès réseau : les routes d'administration ne préchargent pas les photographies.62  DISABLE_IMAGE_PREFETCH: "1",63  RATE_LIMIT_MAX: "1000000",64  RATE_LIMIT_SESSIONS: "1000000",65  RATE_LIMIT_ANSWERS: "1000000",66  PUBLIC_LEADERBOARD_ENABLED: "true",67  LOG_LEVEL: "silent",68  TZ: "America/Toronto",69};7071export default defineConfig({72  test: {73    include: ["tests/**/*.test.ts"],74    env: TEST_ENV,75    globalSetup: ["tests/global-setup.ts"],76    // Une seule base de test : les fichiers s'exécutent l'un après l'autre, dans un seul processus.77    fileParallelism: false,78    pool: "forks",79    poolOptions: { forks: { singleFork: true } },80    sequence: { concurrent: false },81    testTimeout: 60_000,82    hookTimeout: 180_000,83    server: { deps: { external: [/node:sqlite/] } },84  },85});86
Files main
Menu

Theme