Skip to content

Commit

Permalink
Normalize paths for cap
Browse files Browse the repository at this point in the history
This fixes #788.
  • Loading branch information
badeball committed Aug 8, 2022
1 parent 97d3158 commit 5aa1ede
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
29 changes: 29 additions & 0 deletions features/issues/788.feature
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion lib/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
);

Expand Down

0 comments on commit 5aa1ede

Please sign in to comment.