test(integration): add integration test harness on angular unit-test builder

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EvmtStx737hu8gXe15e55W
This commit is contained in:
kamask
2026-10-26 21:17:45 +03:00
co-authored by Claude Opus 5.5
parent 1109f68e11
commit fc55456286
10 changed files with 104 additions and 9 deletions
+6 -2
View File
@@ -1,5 +1,5 @@
// PocketBase SDK clients for tests; each helper returns its own instance with an in-memory auth store.
import { randomUUID } from 'node:crypto';
// Используется и из src/**/*.integration.spec.ts (tsconfig.spec.json), где нет типов Node: поэтому глобальный crypto вместо node:crypto.
import PocketBase, { BaseAuthStore } from 'pocketbase';
import { inject } from 'vitest';
@@ -21,7 +21,11 @@ export async function asSuperuser(): Promise<PocketBase> {
}
export async function createUser(overrides: Record<string, unknown> = {}): Promise<TestUser> {
const data = { email: `user-${randomUUID()}@test.local`, password: randomUUID(), ...overrides };
const data = {
email: `user-${crypto.randomUUID()}@test.local`,
password: crypto.randomUUID(),
...overrides,
};
const record = await (
await asSuperuser()
)
@@ -1,5 +1,5 @@
import type { TestProject } from 'vitest/node';
import { startPocketBase } from '../support/pocketbase-server';
import { startPocketBase } from './pocketbase-server';
export default async function setup(project: TestProject) {
const { url, dataDir, superuser, stop } = await startPocketBase();