GithubHelp home page GithubHelp logo

Comments (2)

lgandecki avatar lgandecki commented on August 20, 2024

Hello @stevepkuo , thanks for reporting!
But this is a bit weird... I just tried in the current version and it worked..
If you could try with the newest version (0.6.0 ) that would be great, maybe I messed up the versions.
But if the problem still persists - could you make a simple reproduction?

I've tried:

let dataToBeLoaded;
let differentDataToBeLoaded;
given("I require a file", () => {
  dataToBeLoaded = require("./requiringFilesData");
});

given("I require a different file", () => {
  differentDataToBeLoaded = require("./requiringDifferentFilesData");
});

then("I can access theirs data", () => {
  expect(dataToBeLoaded.IAmImported).to.equal(true);
  expect(differentDataToBeLoaded.IAmAlsoImported).to.equal(true);
});

and also

const dataToBeLoaded = require("./requiringFilesData");
const differentDataToBeLoaded = require("./requiringDifferentFilesData");

given("I require a file", () => {
});

given("I require a different file", () => {
});

then("I can access theirs data", () => {
  expect(dataToBeLoaded.IAmImported).to.equal(true);
  expect(differentDataToBeLoaded.IAmAlsoImported).to.equal(true);
});

Feature file:

Feature: Requiring Files

  Scenario: Require Two Files
    Given I require a file
    And I require a different file
    Then I can access theirs data

the files I require are trivial:

module.exports = {
  IAmAlsoImported: true
};

and the second one exports "IAmImported: true" in it

from cypress-cucumber-preprocessor.

stevepkuo avatar stevepkuo commented on August 20, 2024

Sorry, it was a mistake on my part. I didn't realize that for my team's project, plugins/index.js was ignoring/overwriting cypress-cucumber-preprocessor's index.js which contains the exact fix I wanted. Once I accounted for that, and used version 0.6.0, the problem went away.

from cypress-cucumber-preprocessor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.