Skip to content

Commit 2766915

Browse files
committed
Make Windows happy
1 parent f15b23e commit 2766915

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

features/json_report.feature

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,9 @@ Feature: JSON formatter
297297
When I run cypress
298298
Then it fails
299299
And there should be no JSON output
300-
And the output should match
300+
And the output should contain
301301
"""
302-
Hook failures can't be represented in JSON reports, thus none is created for cypress[\\\/]e2e[\\\/]a\.feature\.
302+
Hook failures can't be represented in JSON reports, thus none is created for cypress/e2e/a.feature.
303303
"""
304304

305305
Scenario: failing beforeEach hook
@@ -323,9 +323,9 @@ Feature: JSON formatter
323323
When I run cypress
324324
Then it fails
325325
And there should be no JSON output
326-
And the output should match
326+
And the output should contain
327327
"""
328-
Hook failures can't be represented in JSON reports, thus none is created for cypress[\\\/]e2e[\\\/]a\.feature\.
328+
Hook failures can't be represented in JSON reports, thus none is created for cypress/e2e/a.feature.
329329
"""
330330

331331
Scenario: failing afterEach hook
@@ -349,9 +349,9 @@ Feature: JSON formatter
349349
When I run cypress
350350
Then it fails
351351
And there should be no JSON output
352-
And the output should match
352+
And the output should contain
353353
"""
354-
Hook failures can't be represented in JSON reports, thus none is created for cypress[\\\/]e2e[\\\/]a\.feature\.
354+
Hook failures can't be represented in JSON reports, thus none is created for cypress/e2e/a.feature.
355355
"""
356356

357357
Scenario: failing after hook
@@ -375,7 +375,7 @@ Feature: JSON formatter
375375
When I run cypress
376376
Then it fails
377377
And there should be no JSON output
378-
And the output should match
378+
And the output should contain
379379
"""
380-
Hook failures can't be represented in JSON reports, thus none is created for cypress[\\\/]e2e[\\\/]a\.feature\.
380+
Hook failures can't be represented in JSON reports, thus none is created for cypress/e2e/a.feature.
381381
"""

features/step_definitions/cli_steps.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,25 +136,30 @@ Then(
136136
);
137137

138138
Then("the output should contain", function (content) {
139-
assert.match(this.lastRun.stdout, new RegExp(rescape(content)));
139+
assert.match(
140+
this.lastRun.stdout.replaceAll("\\", "/"),
141+
new RegExp(rescape(content))
142+
);
140143
});
141144

142145
Then("if pre-v10, the output should contain", function (content) {
143146
if (isPre10()) {
144-
assert.match(this.lastRun.stdout, new RegExp(rescape(content)));
147+
assert.match(
148+
this.lastRun.stdout.replaceAll("\\", "/"),
149+
new RegExp(rescape(content))
150+
);
145151
}
146152
});
147153

148154
Then("if post-v10, the output should contain", function (content) {
149155
if (isPost10()) {
150-
assert.match(this.lastRun.stdout, new RegExp(rescape(content)));
156+
assert.match(
157+
this.lastRun.stdout.replaceAll("\\", "/"),
158+
new RegExp(rescape(content))
159+
);
151160
}
152161
});
153162

154-
Then("the output should match", function (content) {
155-
assert.match(this.lastRun.stdout, new RegExp(content));
156-
});
157-
158163
Then(
159164
"it should appear to have skipped the scenario {string}",
160165
function (scenarioName) {

0 commit comments

Comments
 (0)