Skip to content

Commit fbbbc20

Browse files
Song-Nan17lgandecki
authored andcommitted
fix: define commonPath based on stepBase.
1 parent 47f360a commit fbbbc20

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/getStepDefinitionsPaths.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const getStepDefinitionsPaths = filePath => {
2020
if (config.nonGlobalStepBaseDir) {
2121
const stepBase = `${appRoot}/${config.nonGlobalStepBaseDir}`;
2222
nonGlobalPath = nonGlobalPath.replace(stepDefinitionPath(), stepBase);
23-
commonPath = `${nonGlobalPath}/../${config.commonPath || "common/"}`;
23+
commonPath = `${stepBase}/${config.commonPath || "common/"}`;
2424
}
2525

2626
const nonGlobalPattern = `${nonGlobalPath}/**/*.+(js|ts)`;

lib/getStepDefinitionsPaths.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ describe("getStepDefinitionsPaths", () => {
8383
const expectedNonGlobalDefinitionPattern =
8484
"cwd/nonGlobalStepBaseDir/test/**/*.+(js|ts)";
8585
const expectedCommonPath =
86-
"cwd/nonGlobalStepBaseDir/test/../common/**/*.+(js|ts)";
86+
"cwd/nonGlobalStepBaseDir/common/**/*.+(js|ts)";
8787

8888
expect(actual).to.include(expectedNonGlobalDefinitionPattern);
8989
expect(actual).to.include(expectedCommonPath);
@@ -97,7 +97,7 @@ describe("getStepDefinitionsPaths", () => {
9797
const actual = getStepDefinitionsPaths(path);
9898

9999
const expectedCommonPath =
100-
"cwd/nonGlobalStepBaseDir/test/../commonPath/**/*.+(js|ts)";
100+
"cwd/nonGlobalStepBaseDir/commonPath/**/*.+(js|ts)";
101101

102102
expect(actual).to.include(expectedCommonPath);
103103
});

0 commit comments

Comments
 (0)