Skip to content

Commit

Permalink
fix: define commonPath based on stepBase.
Browse files Browse the repository at this point in the history
  • Loading branch information
Song-Nan17 authored and lgandecki committed Jul 7, 2020
1 parent 47f360a commit fbbbc20
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/getStepDefinitionsPaths.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const getStepDefinitionsPaths = filePath => {
if (config.nonGlobalStepBaseDir) {
const stepBase = `${appRoot}/${config.nonGlobalStepBaseDir}`;
nonGlobalPath = nonGlobalPath.replace(stepDefinitionPath(), stepBase);
commonPath = `${nonGlobalPath}/../${config.commonPath || "common/"}`;
commonPath = `${stepBase}/${config.commonPath || "common/"}`;
}

const nonGlobalPattern = `${nonGlobalPath}/**/*.+(js|ts)`;
Expand Down
4 changes: 2 additions & 2 deletions lib/getStepDefinitionsPaths.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe("getStepDefinitionsPaths", () => {
const expectedNonGlobalDefinitionPattern =
"cwd/nonGlobalStepBaseDir/test/**/*.+(js|ts)";
const expectedCommonPath =
"cwd/nonGlobalStepBaseDir/test/../common/**/*.+(js|ts)";
"cwd/nonGlobalStepBaseDir/common/**/*.+(js|ts)";

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

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

expect(actual).to.include(expectedCommonPath);
});
Expand Down

0 comments on commit fbbbc20

Please sign in to comment.