jest-cucumber
Version:
Execute Gherkin scenarios in Jest
25 lines • 1.04 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var src_1 = require("../../../../src/");
var online_sales_1 = require("../../src/online-sales");
var feature = src_1.loadFeature('./examples/typescript/specs/features/scenario-outlines.feature');
src_1.defineFeature(feature, function (test) {
var onlineSales;
var salesPrice;
beforeEach(function () {
onlineSales = new online_sales_1.OnlineSales();
});
test('Selling an <Item> at $<Amount>', function (_a) {
var given = _a.given, when = _a.when, then = _a.then;
given(/^I have a\(n\) (.*)$/, function (item) {
onlineSales.listItem(item);
});
when(/^I sell the (.*)$/, function (item) {
salesPrice = onlineSales.sellItem(item);
});
then(/^I should get \$(\d+)$/, function (expectedSalesPrice) {
expect(salesPrice).toBe(parseInt(expectedSalesPrice, 10));
});
});
});
//# sourceMappingURL=scenario-outlines.steps.js.map