init
This commit is contained in:
40
jdenticon-js/test/e2e/base-browser-test.js
Normal file
40
jdenticon-js/test/e2e/base-browser-test.js
Normal file
@@ -0,0 +1,40 @@
|
||||
const tap = require("tap");
|
||||
const canvasRenderer = require("canvas-renderer");
|
||||
|
||||
export function testBrowser(jdenticon, bundle) {
|
||||
tap.test(bundle, bundleTest => {
|
||||
bundleTest.test("jdenticon.bundle", t => {
|
||||
t.equal(jdenticon.bundle, bundle);
|
||||
t.end();
|
||||
});
|
||||
|
||||
bundleTest.test("jdenticon.version", t => {
|
||||
t.match(jdenticon.version, /^\d+(\.\d+)*$/);
|
||||
t.end();
|
||||
});
|
||||
|
||||
bundleTest.test("jdenticon.configure", t => {
|
||||
t.doesNotThrow(() => jdenticon.configure({ backColor: "#fff" }));
|
||||
t.end();
|
||||
});
|
||||
|
||||
bundleTest.test("jdenticon.drawIcon", t => {
|
||||
t.doesNotThrow(() => jdenticon.drawIcon(canvasRenderer.createCanvas(100, 100).getContext("2d"), "Icon1", 100));
|
||||
t.end();
|
||||
});
|
||||
|
||||
bundleTest.test("jdenticon.toSvg", t => {
|
||||
t.match(jdenticon.toSvg("Icon1", 100), /^<svg/);
|
||||
t.end();
|
||||
});
|
||||
|
||||
bundleTest.test("jdenticon.update*", t => {
|
||||
t.type(jdenticon.update, Function);
|
||||
t.type(jdenticon.updateCanvas, Function);
|
||||
t.type(jdenticon.updateSvg, Function);
|
||||
t.end();
|
||||
});
|
||||
|
||||
bundleTest.end();
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user