mirror of
https://github.com/kamask-dev/pchelpmaster.git
synced 2026-11-11 05:49:38 +00:00
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:
co-authored by
Claude Opus 5.5
parent
1109f68e11
commit
fc55456286
@@ -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();
|
||||
Reference in New Issue
Block a user