-
Notifications
You must be signed in to change notification settings - Fork 5
Add tests #16
Comments
I'm on it |
Hey @PierreDemailly 馃憢 Thanks for this amazing work. 馃憦 How goes this issue? Do you need any support? |
Hi @tony-go |
@PierreDemailly awesome ^^ Do you think that you could add a list of stuff you did and what is missing? Thanks again for this amazing job 馃憦 |
Hi @tony-go 馃憢 import crypto from "node:crypto";
import { JSDOM } from "jsdom";
const { window } = (new JSDOM(`
<div id="network-graph"></div>
<div id="network-loader"></div>
`));
const { document } = window;
global.window = window;
global.navigator = window.navigator;
global.document = document;
global.crypto = crypto;
global.Element = window.Element;
global.HTMLCanvasElement = window.HTMLCanvasElement; I've also needed to add I've made my first test: OK. tap.test("it should throw when providing unknown theme", (t) => {
try {
new NodeSecureNetwork(nsDataSet, { theme: "AZJ001" });
}
catch (e) {
t.same(e, new Error("Unknown theme AZJ001. Theme value can be LIGHT or DARK"));
}
finally {
t.end();
}
}); So I've tried somethings like this: t.equal(network.highlightEnabled, false, "highlight is disabled by default");
network.neighbourHighlight({ nodes: [0] });
t.equal(network.highlightEnabled, true, "highlight has been enabled"); (https://github.com/NodeSecure/vis-network/blob/main/src/network.js#L173) But if I call any method from the And now, I'm stuck. Maybe I should completely mock |
I saw that you already add a few test here: main...PierreDemailly:vis-network:feat/add-tests-v1 Maybe you should raise a PR, and then we could merge it. Also if some classes or functions are too broad maybe should we think about the e2e tests as you mentioned. |
We'd like to have tests on this repository 馃И
As much as possible we'd like to use:
tape
ornode-tap
(node-tap
is my new goto)The text was updated successfully, but these errors were encountered: