All checks were successful
Validation applicative / TypeScript, tests et build (push) Successful in 1h3m35s
15 lines
714 B
TypeScript
15 lines
714 B
TypeScript
import { readFile } from "node:fs/promises";
|
|
import { resolve } from "node:path";
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
describe("bootstrap du compte administrateur", () => {
|
|
it("crée le compte administrateur requis après migration sans stocker de mot de passe en clair", async () => {
|
|
const bootstrap = await readFile(resolve(process.cwd(), "server/databaseMigrations.ts"), "utf8");
|
|
|
|
expect(bootstrap).toContain('const INITIAL_ADMIN_LOGIN = "adminItinova"');
|
|
expect(bootstrap).toContain("await ensureInitialAdmin(pool)");
|
|
expect(bootstrap).toContain("await bcrypt.hash(INITIAL_ADMIN_PASSWORD");
|
|
expect(bootstrap).not.toContain("passwordHash: INITIAL_ADMIN_PASSWORD,");
|
|
});
|
|
});
|