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 9dc9938 commit 5153f67
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
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
2 changes: 1 addition & 1 deletion lib/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ 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 5153f67

Please sign in to comment.