mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-15 20:17:22 +00:00
feat: add code-only tests and enhance CLI sync command with seeding option
Introduced a new test suite for code-only applications, validating app creation, database sync behavior, and seeding functionality. Enhanced the CLI sync command to include a seeding option, allowing for explicit seeding during database synchronization. Added error handling for unresolved config files in the run command.
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
SecretSchema,
|
||||
setPath,
|
||||
mark,
|
||||
$console,
|
||||
} from "bknd/utils";
|
||||
import { DebugLogger } from "core/utils/DebugLogger";
|
||||
import { Guard } from "auth/authorize/Guard";
|
||||
@@ -126,7 +127,7 @@ export class ModuleManager {
|
||||
|
||||
constructor(
|
||||
protected readonly connection: Connection,
|
||||
protected options?: Partial<ModuleManagerOptions>,
|
||||
public options?: Partial<ModuleManagerOptions>,
|
||||
) {
|
||||
this.modules = {} as Modules;
|
||||
this.emgr = new EventManager({ ...ModuleManagerEvents });
|
||||
@@ -330,9 +331,8 @@ export class ModuleManager {
|
||||
ctx.flags.sync_required = false;
|
||||
this.logger.log("db sync requested");
|
||||
|
||||
// sync db
|
||||
await ctx.em.schema().sync({ force: true, drop: options?.drop });
|
||||
state.synced = true;
|
||||
// sync db hint
|
||||
$console.warn("a database sync is required");
|
||||
}
|
||||
|
||||
if (ctx.flags.ctx_reload_required) {
|
||||
|
||||
Reference in New Issue
Block a user