Refactor dbTester et dbUtils pour utiliser la nouvelle structure de gestion des projets

This commit is contained in:
2025-01-15 15:23:41 +01:00
parent 85d869368a
commit 50a216903e
2 changed files with 11 additions and 6 deletions

View File

@@ -3,16 +3,15 @@ const databaseUtils = require('../utils/dbUtils');
console.log('Testing database functions...');
async function printProjects() {
const projects = await databaseUtils.getProjects();
const projects = await databaseUtils.projectsTable.getAll();
console.log('Projects:', projects);
}
async function testCreateDestroyProject() {
const project = await databaseUtils.createProject('Test project', 'Test description', new Date(), 0);
console.log('Project created:', project);
await databaseUtils.deleteProject(project.id);
console.log('Project deleted');
const project = await databaseUtils.projectsTable.create('Test Project', 'This is a test project', new Date(), 0);
console.log('Created project:', project);
await databaseUtils.projectsTable.delete(project.id);
console.log('Deleted project:', project);
}
try {