Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(async () => {
const url = `http://example.com/${Math.floor(Math.random()*100)}`;
logger.info("test dbWrite");
const input = {
url: url
};
const res = await dbWrite('tests/url', input);
assert.equal(res.url, url);
logger.info("test dbRead");
const data = await dbRead('tests/url');
assert.equal(data.url, url);
logger.info("test dbRead null");
const dataNull = await dbRead('testNull');
assert.equal(dataNull, null);
done();
})();
}).timeout(5000);
(async () => {
const url = `http://example.com/${Math.floor(Math.random()*100)}`;
logger.info("test dbWrite");
const input = {
url: url
};
const res = await dbWrite('tests/url', input);
assert.equal(res.url, url);
logger.info("test dbRead");
const data = await dbRead('tests/url');
assert.equal(data.url, url);
logger.info("test dbRead null");
const dataNull = await dbRead('testNull');
assert.equal(dataNull, null);
done();
})();
}).timeout(5000);
(async () => {
const url = `http://example.com/${Math.floor(Math.random()*100)}`;
logger.info("test dbWrite");
const input = {
url: url
};
const res = await dbWrite('tests/url', input);
assert.equal(res.url, url);
logger.info("test dbRead");
const data = await dbRead('tests/url');
assert.equal(data.url, url);
logger.info("test dbRead null");
const dataNull = await dbRead('testNull');
assert.equal(dataNull, null);
done();
})();