diff --git a/CHANGELOG.md b/CHANGELOG.md index 3030adfb..e4d4248d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ All notable changes to this project will be documented in this file. - Allow overriding env using tags, fixes [#792](https://github.com/badeball/cypress-cucumber-preprocessor/issues/792). +- Correct some path handling on Windows, fixes [#788](https://github.com/badeball/cypress-cucumber-preprocessor/issues/788). + ## v12.0.0 Breaking changes: diff --git a/features/issues/788.feature b/features/issues/788.feature new file mode 100644 index 00000000..2f27abb7 --- /dev/null +++ b/features/issues/788.feature @@ -0,0 +1,29 @@ +# https://github.com/badeball/cypress-cucumber-preprocessor/issues/788 + +Feature: calculating common ancestor path + Scenario: + Given a file named "cypress/e2e/1/a.feature" with: + """ + Feature: a feature + Scenario: a scenario + Given a step + """ + And a file named "cypress/e2e/2/a.feature" with: + """ + Feature: a feature + Scenario: a scenario + Given a step + """ + And a file named "cypress/e2e/3/a.feature" with: + """ + Feature: a feature + Scenario: a scenario + Given a step + """ + And a file named "cypress/support/step_definitions/steps.js" with: + """ + const { Given } = require("@badeball/cypress-cucumber-preprocessor"); + Given("a step", function() {}) + """ + When I run cypress + Then it passes diff --git a/lib/template.ts b/lib/template.ts index 85e7deee..aa4bda0f 100644 --- a/lib/template.ts +++ b/lib/template.ts @@ -65,7 +65,9 @@ export async function compile( const pickles = envelopes.map((envelope) => envelope.pickle).filter(notNull); const implicitIntegrationFolder = assertAndReturn( - ancestor(...getTestFiles(configuration).map(path.dirname)), + ancestor( + ...getTestFiles(configuration).map(path.dirname).map(path.normalize) + ), "Expected to find a common ancestor path" );