mirror of
https://github.com/Such-Software/wownerogue.git
synced 2026-10-17 22:31:26 +02:00
A browser-based roguelike synchronized with crypto block timing. A run is a race against the next block: reach the exit before the block lands, or the house wins. The same codebase runs the solo dungeon, the social Tavern, and operator-selected PvP and race rulesets, with separate free and paid leaderboards. Self-hostable under the MIT License. See README.md to run it, docs/ARCHITECTURE.md for the design, and docs/DEPLOY.md to operate an instance.
16 lines
521 B
JavaScript
16 lines
521 B
JavaScript
const DatabaseManager = require('../src/db/databaseManager');
|
|
|
|
describe('DatabaseManager readiness freshness', () => {
|
|
test('requires both a connection and a recent successful query', () => {
|
|
const db = new DatabaseManager();
|
|
expect(db.isHealthy()).toBe(false);
|
|
|
|
db.connected = true;
|
|
db.lastSuccessfulQueryAt = Date.now();
|
|
expect(db.isHealthy(1000)).toBe(true);
|
|
|
|
db.lastSuccessfulQueryAt = Date.now() - 2000;
|
|
expect(db.isHealthy(1000)).toBe(false);
|
|
});
|
|
});
|