UNPKG

card-games-utils

Version:
17 lines (16 loc) 986 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var StandardDeckEnum_1 = require("../constants/StandardDeckEnum"); var StandardDeck_1 = require("../data/StandardDeck"); describe('test the StandardDeck data and all methods in it', function () { it('test getStandardDeck() method', function () { var cardsWithoutJoker = StandardDeck_1.StandardDeck.getStandardDeck(); expect(Array.isArray(cardsWithoutJoker)).toBe(true); expect(cardsWithoutJoker.length).toBe(52); expect(cardsWithoutJoker.every(function (card) { return card.name !== StandardDeckEnum_1.StandardCardName.JOKER; })).toBe(true); var cardsWithJoker = StandardDeck_1.StandardDeck.getStandardDeck(true); expect(Array.isArray(cardsWithJoker)).toBe(true); expect(cardsWithJoker.length).toBe(53); expect(cardsWithJoker.some(function (card) { return card.name === StandardDeckEnum_1.StandardCardName.JOKER; })).toBe(true); }); });