You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: allow extensions for the rc configuration file.
Current cosmiconfig versions advertises extensions for rc files.
Enabling 'rcExtensions' also allows cosmiconfig4 to search for rc files ending with .json, .js etc.
// left for backward compability, but we need the consistency with other configuration options
14
10
constconfStepDefinitions=config.step_definitions
15
11
? config.step_definitions
@@ -21,7 +17,7 @@ module.exports = () => {
21
17
22
18
if(!fs.existsSync(stepsPath)){
23
19
thrownewError(
24
-
`We've tried to resolve your step definitions at ${relativePath}, but that doesn't seem to exist. As of version 2.0.0 it's required to set step_definitions in your cypress-cucumber-preprocessor configuration. Currently your configuration is in: ${filepath}. Look for nonGlobalStepDefinitions and add stepDefinitions right next to it. It should match your cypress configuration has set for integrationFolder. We no longer rely on getting information from that file as it was unreliable and problematic across Linux/MacOS/Windows especially since the config file could have been passed as an argument to cypress.`
20
+
`We've tried to resolve your step definitions at ${relativePath}, but that doesn't seem to exist. As of version 2.0.0 it's required to set step_definitions in your cypress-cucumber-preprocessor configuration. Look for nonGlobalStepDefinitions and add stepDefinitions right next to it. It should match your cypress configuration has set for integrationFolder. We no longer rely on getting information from that file as it was unreliable and problematic across Linux/MacOS/Windows especially since the config file could have been passed as an argument to cypress.`
test("Should throw an error if nonGlobalStepDefinitions and stepDefinitions are not set and the default is wrong",()=>{
20
-
constCOMICONFIG_FILEPATH="package.json";
21
-
constloadMock=jest.fn().mockReturnValue({
22
-
config: {
23
-
nonGlobalStepDefinitions: true
24
-
},
25
-
filepath: COMICONFIG_FILEPATH
26
-
});
27
-
cosmiconfig.mockReturnValue({
28
-
load: loadMock
19
+
getConfig.mockReturnValue({
20
+
nonGlobalStepDefinitions: true
29
21
});
30
-
fs.existsSync.mockReturnValue(false);
31
22
32
-
consterrorMessage=`We've tried to resolve your step definitions at ${defaultNonGlobalStepDefinitionsPath}, but that doesn't seem to exist. As of version 2.0.0 it's required to set step_definitions in your cypress-cucumber-preprocessor configuration. Currently your configuration is in: ${COMICONFIG_FILEPATH}. Look for nonGlobalStepDefinitions and add stepDefinitions right next to it. It should match your cypress configuration has set for integrationFolder. We no longer rely on getting information from that file as it was unreliable and problematic across Linux/MacOS/Windows especially since the config file could have been passed as an argument to cypress.`;
23
+
consterrorMessage=`We've tried to resolve your step definitions at ${defaultNonGlobalStepDefinitionsPath}, but that doesn't seem to exist. As of version 2.0.0 it's required to set step_definitions in your cypress-cucumber-preprocessor configuration. Look for nonGlobalStepDefinitions and add stepDefinitions right next to it. It should match your cypress configuration has set for integrationFolder. We no longer rely on getting information from that file as it was unreliable and problematic across Linux/MacOS/Windows especially since the config file could have been passed as an argument to cypress.`;
33
24
expect(stepDefinitionPath).throw(errorMessage);
34
25
});
35
26
36
27
test("Should throw an error if nonGlobalStepDefinitions and stepDefinitions are set but the folder doesn't exist",()=>{
37
-
constCOMICONFIG_FILEPATH="package.json";
38
28
conststepDefinitions="cypress/stepDefinitions";
39
-
constloadMock=jest.fn().mockReturnValue({
40
-
config: {
41
-
nonGlobalStepDefinitions: true,
42
-
stepDefinitions
43
-
},
44
-
filepath: COMICONFIG_FILEPATH
45
-
});
46
-
cosmiconfig.mockReturnValue({
47
-
load: loadMock
29
+
getConfig.mockReturnValue({
30
+
nonGlobalStepDefinitions: true,
31
+
stepDefinitions
48
32
});
49
-
fs.existsSync.mockReturnValue(false);
50
33
51
-
consterrorMessage=`We've tried to resolve your step definitions at ${stepDefinitions}, but that doesn't seem to exist. As of version 2.0.0 it's required to set step_definitions in your cypress-cucumber-preprocessor configuration. Currently your configuration is in: ${COMICONFIG_FILEPATH}. Look for nonGlobalStepDefinitions and add stepDefinitions right next to it. It should match your cypress configuration has set for integrationFolder. We no longer rely on getting information from that file as it was unreliable and problematic across Linux/MacOS/Windows especially since the config file could have been passed as an argument to cypress.`;
34
+
consterrorMessage=`We've tried to resolve your step definitions at ${stepDefinitions}, but that doesn't seem to exist. As of version 2.0.0 it's required to set step_definitions in your cypress-cucumber-preprocessor configuration. Look for nonGlobalStepDefinitions and add stepDefinitions right next to it. It should match your cypress configuration has set for integrationFolder. We no longer rely on getting information from that file as it was unreliable and problematic across Linux/MacOS/Windows especially since the config file could have been passed as an argument to cypress.`;
52
35
expect(stepDefinitionPath).throw(errorMessage);
53
36
});
54
37
55
38
test("should use the default stepDefinitions path for nonGlobalStepDefinitions",()=>{
0 commit comments