refactor(flags): migrate skip migrations flag (#27705)

This commit is contained in:
Shoubhit Dash
2026-05-15 14:54:29 +05:30
committed by GitHub
parent 7b370406a9
commit 356f684186
5 changed files with 36 additions and 6 deletions

View File

@@ -26,4 +26,13 @@ describe("Database.getChannelPath", () => {
expect(Database.getChannelPath(flags)).toBe(path.join(Global.Path.data, "opencode.db"))
}).pipe(Effect.provide(RuntimeFlags.layer({ disableChannelDb: true }))),
)
it.effect("accepts RuntimeFlags with skipMigrations for database callers", () =>
Effect.gen(function* () {
const flags = yield* RuntimeFlags.Service
expect(flags.skipMigrations).toBe(true)
expect(Database.getChannelPath(flags)).toBe(Database.getChannelPath({ disableChannelDb: flags.disableChannelDb }))
}).pipe(Effect.provide(RuntimeFlags.layer({ skipMigrations: true }))),
)
})