mirror of
https://github.com/prymitive/karma
synced 2026-05-07 03:26:52 +00:00
Fix watchdog tests
This commit is contained in:
@@ -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());
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user