Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const { when, then } = require("cypress-cucumber-preprocessor"); // eslint-disable-line
let code = "";
// eslint-disable-next-line prefer-const
let variableToVerify = ""; // we are assigning this through eval
when("I use DocString for code like this:", dataString => {
code = dataString;
});
then("I ran it and verify that it executes it", () => {
// eslint-disable-next-line no-eval
eval(code);
expect(variableToVerify).to.equal("hello world");
});
const { given, when, then } = require("cypress-cucumber-preprocessor"); // eslint-disable-line
given("a feature and a matching step definition file", () => {
expect(true).to.equal(true);
});
when("I run cypress tests", () => {
expect(true).to.equal(true);
});
then("they run properly", () => {
expect(true).to.equal(true);
});
const { when, then } = require("cypress-cucumber-preprocessor"); // eslint-disable-line
// you can have external state, and also require things!
let sum = 0;
when("I add {int} and {int}", (a, b) => {
sum = a + b;
});
then("I verify that the result is equal the {string}", result => {
expect(sum).to.equal(result);
});