1
0
forked from apxtri/apxtrib

44 lines
890 B
JavaScript
Raw Permalink Normal View History

2023-04-13 07:46:35 +02:00
/*
Unit testing
*/
const assert = require("assert");
2023-11-05 12:03:25 +01:00
const fs = require("fs-extra");
const path = require("path");
2023-04-13 07:46:35 +02:00
const Odmdb = require("../Odmdb.js");
2023-11-05 12:03:25 +01:00
const { generemdp } = require("../toolsbox.js");
const conf = require(`${process.env.dirtown}/conf.json`);
2023-04-13 07:46:35 +02:00
const ut = { name: "Odmdb" };
/*
2023-11-05 12:03:25 +01:00
Test crud process for any object
2023-04-13 07:46:35 +02:00
*/
2023-11-05 12:03:25 +01:00
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:""}
2023-04-13 07:46:35 +02:00
2023-11-05 12:03:25 +01:00
const testitms=[
{objectPathname:`${conf.dirapi}/nationchains/pagans`,
itm:{alias:'toutou', publickey:}}
]
2023-04-13 07:46:35 +02:00
2023-11-05 12:03:25 +01:00
ut.run = (options) => {
let msg=""
testitms.forEach(i=>{
ut.crud(i)
//si erreur add msg+++
})
assert.deepEqual(msg, "", msg);
};
module.exports = ut;