File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed
Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ # https://github.com/badeball/cypress-cucumber-preprocessor/issues/736
2+
3+ Feature : create output directories
4+ Background :
5+ Given additional preprocessor configuration
6+ """
7+ {
8+ "messages": {
9+ "enabled": true,
10+ "output": "foo/cucumber-messages.ndjson"
11+ },
12+ "json": {
13+ "enabled": true,
14+ "output": "bar/cucumber-report.json"
15+ }
16+ }
17+ """
18+ And I've ensured cucumber-json-formatter is installed
19+
20+ Scenario :
21+ Given a file named "cypress/e2e/a.feature" with:
22+ """
23+ Feature: a feature
24+ Scenario: a scenario
25+ Given a step
26+ """
27+ And a file named "cypress/support/step_definitions/steps.js" with:
28+ """
29+ const { Given } = require("@badeball/cypress-cucumber-preprocessor");
30+ Given("a step", function() {})
31+ """
32+ When I run cypress
33+ Then it passes
Original file line number Diff line number Diff line change @@ -91,6 +91,8 @@ export async function afterRunHandler(config: Cypress.PluginConfigOptions) {
9191 return ;
9292 }
9393
94+ await fs . mkdir ( path . dirname ( jsonPath ) , { recursive : true } ) ;
95+
9496 const messages = await fs . open ( messagesPath , "r" ) ;
9597
9698 try {
@@ -156,6 +158,8 @@ export async function afterSpecHandler(
156158 )
157159 ) ;
158160 } else {
161+ await fs . mkdir ( path . dirname ( messagesPath ) , { recursive : true } ) ;
162+
159163 await fs . writeFile (
160164 messagesPath ,
161165 currentSpecMessages . map ( ( message ) => JSON . stringify ( message ) ) . join ( "\n" ) +
You can’t perform that action at this time.
0 commit comments