Skip to content

Commit

Permalink
test: add test for outline with placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
Papooch committed Mar 24, 2024
1 parent 88ba27e commit 69b5169
Showing 1 changed file with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { StepDefinitions, autoBindSteps, loadFeature } from '../../../../src';
import { OnlineSales } from '../../src/online-sales';

export const salesSteps: StepDefinitions = ({ given, when, then }) => {
let onlineSales: OnlineSales;
let salesPrice: number | null;

beforeEach(() => {
onlineSales = new OnlineSales();
});

given(/^I have a\(n\) (.+)$/, (item: string) => {
onlineSales.listItem(item);
});

when(/^I sell the (.+)$/, (item: string) => {
salesPrice = onlineSales.sellItem(item);
});

then(/^I should get \$(\d+)$/, (expectedSalesPrice: string) => {
expect(salesPrice).toBe(parseInt(expectedSalesPrice, 10));
});
};

const feature = loadFeature('./examples/typescript/specs/features/scenario-outlines.feature');

autoBindSteps([feature], [salesSteps]);

0 comments on commit 69b5169

Please sign in to comment.