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
commit 356f684186
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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 }))),
)
})