Fix watchdog tests

This commit is contained in:
Łukasz Mierzwa
2017-07-19 22:05:22 -07:00
parent f8357689ad
commit 07a272e493

View File

@@ -1,9 +1,16 @@
const watchdog = require("./watchdog");
const moment = require("moment");
test("watchdog init", () => {
test("watchdog init()", () => {
watchdog.init();
});
test("watchdog getTs without pong", () => {
expect(watchdog.getTs).toBe(undefined);
test("watchdog getLastUpdate() without pong", () => {
expect(watchdog.getLastUpdate()).toBe(0);
});
test("watchdog getLastUpdate() with pong", () => {
var ts = moment();
watchdog.pong(ts);
expect(watchdog.getLastUpdate()).toBe(ts.utc().unix());
});