/var/www/greso.tech/server/nsm/node_modules/qrcode-svg/test
Edit: /var/www/greso.tech/server/nsm/node_modules/qrcode-svg/test/test.js (10996B)
var QRCode = require('../lib/qrcode.js');
function generateRandomString(length) {
var result = "";
var charset = "abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
for (var i = 0, n = charset.length; i < length; ++i) {
result += charset.charAt(Math.floor(Math.random() * n));
}
return result;
}
exports["Test SVG output"] = function(test) {
test.expect(6);
var qrcode = new QRCode("Hello World!");
test.ok(typeof qrcode == "object", "Expected object as the result!");
test.ok(typeof qrcode.svg == "function", "Missing 'svg' function!");
test.ok(typeof qrcode.save == "function", "Missing 'save' function!");
var svg = qrcode.svg();
test.ok(typeof svg == "string", "Expected string as the result!");
test.ok(/\