jest-cucumber
Version:
Execute Gherkin scenarios in Jest
24 lines • 1.12 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var src_1 = require("../../../../src/");
var bank_account_1 = require("../../src/bank-account");
var feature = src_1.loadFeature('./examples/typescript/specs/features/using-dynamic-values.feature');
src_1.defineFeature(feature, function (test) {
var myAccount;
beforeEach(function () {
myAccount = new bank_account_1.BankAccount();
});
test('Depositing a paycheck', function (_a) {
var given = _a.given, when = _a.when, then = _a.then, pending = _a.pending;
given(/^my account balance is \$(\d+)$/, function (balance) {
myAccount.deposit(parseInt(balance, 10));
});
when(/^I get paid \$(\d+) for writing some awesome code$/, function (paycheck) {
myAccount.deposit(parseInt(paycheck, 10));
});
then(/^my account balance should be \$(\d+)$/, function (expectedBalance) {
expect(myAccount.balance).toBe(parseInt(expectedBalance, 10));
});
});
});
//# sourceMappingURL=using-dynamic-values.steps.js.map