Skip to content

Commit c5a4897

Browse files
committed
Change neo4j database names for Jest to be human identifiable
1 parent faedd82 commit c5a4897

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/core/config/config.service.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import type {
55
} from '@seedcompany/nestjs-email';
66
import type { Server as HttpServer } from 'http';
77
import { type LRUCache } from 'lru-cache';
8-
import { Duration, type DurationLike } from 'luxon';
9-
import { nanoid } from 'nanoid';
8+
import { DateTime, Duration, type DurationLike } from 'luxon';
9+
import { customAlphabet } from 'nanoid';
1010
import { type Config as Neo4JDriverConfig } from 'neo4j-driver';
1111
import { BehaviorSubject } from 'rxjs';
1212
import type { Class, Merge, ReadonlyDeep } from 'type-fest';
@@ -175,7 +175,9 @@ export const makeConfig = (env: EnvironmentService) =>
175175
username,
176176
password,
177177
database: this.jest
178-
? `test.${nanoid().replace(/[-_]/g, '')}`
178+
? `test.${DateTime.now().toFormat(
179+
'y-MM-dd.HH-mm-ss',
180+
)}.${customAlphabet('abcdefghjkmnpqrstuvwxyz', 7)()}`
179181
: database,
180182
ephemeral: this.jest,
181183
driverConfig,

0 commit comments

Comments
 (0)