1
0
forked from apxtri/apxtri

43 lines
782 B
JavaScript
Raw Normal View History

2023-12-07 12:04:19 +01:00
/*
Unit testing
*/
const assert = require("assert");
const fs = require("fs-extra");
const path = require("path");
const Odmdb = require("../Odmdb.js");
2024-05-27 19:51:28 +02:00
2023-12-07 12:04:19 +01:00
const ut = { name: "Odmdb" };
/*
Test crud process for any object
*/
ut.crud = (objectPathname, itm, profils) => {
//
// test if exist
// if not test create
// test to read
// test update
// test delete
const res = { status: 200, err: [] };
return res;
};
const testvar={alias:"tutu", passphrase:"",privatekey:"", publickey:""}
const testitms=[
2024-05-27 19:51:28 +02:00
{objectPathname:`../..//adminapi/opjects/pagans`,
itm:{alias:'toutou', publickey:""}}
2023-12-07 12:04:19 +01:00
]
ut.run = (options) => {
let msg=""
testitms.forEach(i=>{
ut.crud(i)
//si erreur add msg+++
})
assert.deepEqual(msg, "", msg);
};
module.exports = ut;