Closed smvilar closed 2 years ago
This won't be enough for me to help. Please show the error message. Are you on Windows? Is everything working fine with the last 1.* Version? Please stick with that meanwhile. Do you use Vue? Any chance for a simple reproduction?
Sorry! I've been tinkering a bit more and the issue was defining the commonPath
value. I removed that setting and everything worked again. 😄
To reproduce the issue, just go to the example repo you have and make the following changes:
"integrationFolder": "cypress/e2e"
in the cypress.jsonError: Cannot find module 'cypress/e2e/common/I_see_STRING_in_the_title.js' from '/dev/cypress-cucumber-example/cypress/e2e/socialNetworks'
I'm not sure if this is an issue in the documentation or if it's not an issue at all. Feel free to close it.
I agree with @smvilar .
The comment from v2.0.1 related commit kind of broke the setting. Had to remove commonPath and also stepDefinitions setting is not required to work it with 2.0.1
BREAKING CHANGE: You need to configure the stepDefinitions if you use the nonGlobalStepDefinitions option.
It is indeed working fine with below usual setting in package.json
"cypress-cucumber-preprocessor": { "nonGlobalStepDefinitions": true, }
I guess the message should say "if things don't work you need to configure the stepDefinitions", but, also, I'm not sure how setting the stepDefinitions to a correct path could break anything? My thinking was that it's better if anyone just explicitly set the path to the stepDefinitions, instead of relying on defaults from Cypress (that we don't control)
I'm having issues on Windows with 2.0.1.. it shows this error:
Error: load and loadSync must pass a non-empty string
at Explorer.validateFilePath (C:\Anta\generator\node_modules\cosmiconfig\dist\createExplorer.js:269:13)
at C:\Anta\generator\node_modules\cosmiconfig\dist\createExplorer.js:275:12
It seems to give the same error no matter the config I throw at it...
"cypress-cucumber-preprocessor": {
"nonGlobalStepDefinitions": true,
"stepDefinitions": "cypress/integration",
"commonPath": "cypress/integration/common"
}
@jvanoostveen above configuration looks ok. But since cosmic config can throw error from any other parts of the packages.json file, please review entire file and not just this part.
Guys, how it must be working if in your code you execute
const loader = cosmiconfig("cypress-cucumber-preprocessor"; const loaded = explorer.load(); https://github.com/TheBrainFamily/cypress-cucumber-preprocessor/blob/master/lib/getConfig.js#L13
but its not by documentation of cosmiconfig https://github.com/davidtheclark/cosmiconfig#explorerload
you need to pass here file name like const result = explorerSync.load(loadPath);
and have a trouble if (!filepath) { throw new Error('load must pass a non-empty string'); } https://github.com/davidtheclark/cosmiconfig/blob/main/src/ExplorerBase.ts#L130
It's a singleton pattern, we load the cosmiconfig once:
if (!explorer) {
explorer = cosmiconfig("cypress-cucumber-preprocessor", {
sync: true,
rcExtensions: true,
});
}
the name of the package is used to look for the configuration, on subsequent calls to this function it just reuses the already loaded configuration
Due to personal reasons, the previous maintainers of this package are stepping down and handing the reigns over to me, a long-time contributor to the project and a user of it myself. This is a responsibility I'm very excited about. Furthermore, I'd like to thank @lgandecki ++ for all the work that they've done so far.
Read more about the transfer of ownership here.
The repository has however moved and all outstanding issues are being closed. This is not a reflection of the perceived importance of your reported issue. However, if after upgrading to the new version, you still find there to be an issue, feel free to open up another ticket or comment below. Please make sure to read CONTRIBUTING.md before doing so.
Since the 2.0.1 version I can't run my tests anymore. I read the changelog and I added the required config to my package.json:
(instead of being in
cypress/integration
, my tests are incypress/e2e
)This doesn't work. Am I reading something wrong from the documentation?