did more of the knex -> sqlite migration.

This commit is contained in:
Jordan Hewitt
2025-03-10 10:32:27 -07:00
parent 3616592896
commit 8f67d0421b
5 changed files with 67 additions and 59 deletions

View File

@ -3,9 +3,10 @@ import { render, screen, fireEvent, act } from "@testing-library/react-native";
import SettingsComponent from "@/components/Settings";
import { language_matrix } from "@/app/i18n/api";
import { Settings } from "@/app/lib/settings";
import { getDb } from "@/app/lib/db";
import { getDb, migrateDb } from "@/app/lib/db";
import { Knex } from "knex";
import { WhisperFile } from "@/app/lib/whisper";
import { SQLiteDatabase } from "expo-sqlite";
const RENDER_TIME = 1000;
@ -77,7 +78,7 @@ jest.mock("@/app/i18n/api", () => {
describe("SettingsComponent", () => {
let db: Knex;
let db: SQLiteDatabase;
let settings: Settings;
beforeEach(async () => {
@ -90,8 +91,7 @@ describe("SettingsComponent", () => {
afterEach(async () => {
jest.restoreAllMocks();
await db.migrate.down();
await db.destroy();
await migrateDb("development", "down");
});
beforeAll(async () => {