1
0
forked from apxtri/apxtri

44 lines
870 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");
const { generemdp } = require("../toolsbox.js");
const conf = require(`../../conf/townconf.json`);
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=[
{objectPathname:`../nationchains/pagans`,
itm:{alias:'toutou', publickey:}}
]
ut.run = (options) => {
let msg=""
testitms.forEach(i=>{
ut.crud(i)
//si erreur add msg+++
})
assert.deepEqual(msg, "", msg);
};
module.exports = ut;