jest-cucumber
Version:
Execute Gherkin scenarios in Jest
30 lines • 1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ArcadeMachine = exports.COIN_TYPES = void 0;
exports.COIN_TYPES = {
USQuarter: { value: 0.25, issuingNation: 'USA' },
CanadianQuarter: { value: 0.25, issuingNation: 'Canada' },
Unknown: { value: 0, issuingNation: 'Unknown' },
};
var ArcadeMachine = /** @class */ (function () {
function ArcadeMachine() {
this.acceptedCoinType = null;
this.balance = 0;
this.requireCoins = true;
}
ArcadeMachine.prototype.insertCoin = function (coinType) {
if (!this.requireCoins) {
return 'CoinReturned';
}
if (coinType === this.acceptedCoinType) {
this.balance += coinType.value;
return 'CoinAccepted';
}
else {
return 'CoinReturned';
}
};
return ArcadeMachine;
}());
exports.ArcadeMachine = ArcadeMachine;
//# sourceMappingURL=arcade-machine.js.map