fix sqlite bootstrap and site announcement migration
This commit is contained in:
1 parent
79146af16a
commit
9bc804c121
4 files changed
+246
-7
No files matched your search
@@ -1,7 +1,27 @@
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
import { ensureRuntimeDatabaseReady } from './runtimeDatabaseBootstrap.js';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { runSqliteMigrations } from './db/migrate.js';
|
||||
import {
|
||||
__runtimeDatabaseBootstrapTestUtils,
|
||||
ensureRuntimeDatabaseReady,
|
||||
runSqliteRuntimeMigrations,
|
||||
} from './runtimeDatabaseBootstrap.js';
|
||||
|
||||
vi.mock('./db/migrate.js', () => ({
|
||||
runSqliteMigrations: vi.fn(),
|
||||
}));
|
||||
|
||||
describe('runtimeDatabaseBootstrap', () => {
|
||||
beforeEach(() => {
|
||||
__runtimeDatabaseBootstrapTestUtils.resetSqliteMigrationsBootstrapped();
|
||||
vi.clearAllMocks();
|
||||
});
|
||||
|
||||
it('runs sqlite migrations on the first runtime bootstrap call', async () => {
|
||||
await runSqliteRuntimeMigrations();
|
||||
|
||||
expect(runSqliteMigrations).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('runs sqlite runtime migrations when dialect is sqlite', async () => {
|
||||
const runSqliteRuntimeMigrations = vi.fn(async () => {});
|
||||
const ensureExternalRuntimeSchema = vi.fn(async () => {});
|
||||
|
||||
Reference in new issue
Block a user