fix some sqlite errors.
This commit is contained in:
@ -7,12 +7,14 @@ describe('Settings', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
// Initialize your Settings class here with a fresh database instance
|
||||
settings = new Settings(await getDb());
|
||||
const db = await getDb();
|
||||
if (!db) throw new Error("Could not get db");
|
||||
settings = new Settings(db);
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
// Clean up the database after each test
|
||||
await settings.db.executeSql('DELETE FROM settings');
|
||||
settings && await settings.db.executeSql('DELETE FROM settings');
|
||||
});
|
||||
|
||||
describe('setHostLanguage', () => {
|
||||
@ -57,7 +59,7 @@ describe('Settings', () => {
|
||||
it('should return the LibreTranslate base URL from the database', async () => {
|
||||
const value = 'https://another-example.com';
|
||||
await settings.db.executeSql(
|
||||
`INSERT INTO settings (libetransalte_base_url) VALUES (?)`,
|
||||
`INSERT INTO settings (libretranslate_base_url) VALUES (?)`,
|
||||
[value]
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user