refactor: convert activity stub to a factory (#16702)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Insertable, Kysely } from 'kysely';
|
||||
import { randomBytes, randomUUID } from 'node:crypto';
|
||||
import { randomBytes } from 'node:crypto';
|
||||
import { Writable } from 'node:stream';
|
||||
import { Assets, DB, Partners, Sessions, Users } from 'src/db';
|
||||
import { AuthDto } from 'src/dtos/auth.dto';
|
||||
@@ -36,6 +36,7 @@ import { VersionHistoryRepository } from 'src/repositories/version-history.repos
|
||||
import { ViewRepository } from 'src/repositories/view-repository';
|
||||
import { newLoggingRepositoryMock } from 'test/repositories/logger.repository.mock';
|
||||
import { newTelemetryRepositoryMock } from 'test/repositories/telemetry.repository.mock';
|
||||
import { newUuid } from 'test/small.factory';
|
||||
|
||||
class CustomWritable extends Writable {
|
||||
private data = '';
|
||||
@@ -59,8 +60,6 @@ type User = Partial<Insertable<Users>>;
|
||||
type Session = Omit<Insertable<Sessions>, 'token'> & { token?: string };
|
||||
type Partner = Insertable<Partners>;
|
||||
|
||||
export const newUuid = () => randomUUID() as string;
|
||||
|
||||
export class TestFactory {
|
||||
private assets: Asset[] = [];
|
||||
private sessions: Session[] = [];
|
||||
|
||||
Reference in New Issue
Block a user