Skip to content

Commit 5aa1ede

Browse files
committed
Normalize paths for cap
This fixes #788.
1 parent 97d3158 commit 5aa1ede

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ All notable changes to this project will be documented in this file.
66

77
- Allow overriding env using tags, fixes [#792](https://github.com/badeball/cypress-cucumber-preprocessor/issues/792).
88

9+
- Correct some path handling on Windows, fixes [#788](https://github.com/badeball/cypress-cucumber-preprocessor/issues/788).
10+
911
## v12.0.0
1012

1113
Breaking changes:

features/issues/788.feature

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# https://github.com/badeball/cypress-cucumber-preprocessor/issues/788
2+
3+
Feature: calculating common ancestor path
4+
Scenario:
5+
Given a file named "cypress/e2e/1/a.feature" with:
6+
"""
7+
Feature: a feature
8+
Scenario: a scenario
9+
Given a step
10+
"""
11+
And a file named "cypress/e2e/2/a.feature" with:
12+
"""
13+
Feature: a feature
14+
Scenario: a scenario
15+
Given a step
16+
"""
17+
And a file named "cypress/e2e/3/a.feature" with:
18+
"""
19+
Feature: a feature
20+
Scenario: a scenario
21+
Given a step
22+
"""
23+
And a file named "cypress/support/step_definitions/steps.js" with:
24+
"""
25+
const { Given } = require("@badeball/cypress-cucumber-preprocessor");
26+
Given("a step", function() {})
27+
"""
28+
When I run cypress
29+
Then it passes

lib/template.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ export async function compile(
6565
const pickles = envelopes.map((envelope) => envelope.pickle).filter(notNull);
6666

6767
const implicitIntegrationFolder = assertAndReturn(
68-
ancestor(...getTestFiles(configuration).map(path.dirname)),
68+
ancestor(
69+
...getTestFiles(configuration).map(path.dirname).map(path.normalize)
70+
),
6971
"Expected to find a common ancestor path"
7072
);
7173

0 commit comments

Comments
 (0)