@gameye/sdk
Version:
Node.js SDK for Gameye
24 lines • 1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const test = require("blue-tape");
const mocks = require("../mocks");
const match_1 = require("./match");
test("selectMatchList", async (t) => {
const matchList = match_1.selectMatchList(mocks.matchStateMock);
t.equal(matchList.length, 2);
t.equal(matchList.filter(i => i.matchKey === "test-match-123").length, 1);
t.equal(matchList.filter(i => i.matchKey === "test-match-456").length, 1);
});
test("selectMatchListForGame", async (t) => {
const matchList = match_1.selectMatchListForGame(mocks.matchStateMock, "test");
t.equal(matchList.length, 1);
t.equal(matchList.filter(i => i.matchKey === "test-match-123").length, 1);
});
test("selectMatchItem", async (t) => {
const matchItem = match_1.selectMatchItem(mocks.matchStateMock, "test-match-123");
t.ok(matchItem);
if (matchItem) {
t.equal(matchItem.matchKey, "test-match-123");
}
});
//# sourceMappingURL=match.spec.js.map