cucumber-messages.ndjson persists after cypress run with cucumber-preprocessor and reporting is completed

151 Views Asked by At

I am running cypress with this in package.json:

{
"cypress-cucumber-preprocessor": {
"nonGlobalStepDefinitions": true,
"filterSpecs": true,
"json": {
  "enabled": true,
  "output": "./test/report/cucumber_report.json",
  "formatter": "./bin/cucumber-json-formatter-linux"
},
  "messages": {
    "enabled": true
},
"stepDefinitions": [
  "e2e/hello-world/**/*.{js,ts}",
  "e2e/[filepath].{js,ts}"
]
  },
"devDependencies": {
    "@badeball/cypress-cucumber-preprocessor": "^15.0.0",
    "@cypress/webpack-preprocessor": "^5.15.0",
    "cypress": "^11.2.0",
    "multiple-cucumber-html-reporter": "^3.5.0",
    "ts-loader": "^9.4.1",
    "typescript": "^4.8.4",
    "webpack": "^5.74.0"
  }

a script uses multiple-cucumber-html-reporter to produce the html report:

const report = require('multiple-cucumber-html-reporter');

report.generate({
    jsonDir: './test/report',
    reportPath: './test/report/html',
});

The tests are running fine and producing a report and json correctly, but the cucumber-messages.ndjson is also persisting:

.
|-- cucumber-html-report.js
|-- cucumber-messages.ndjson
|-- cypress.config.ts
|-- package-lock.json
|-- package.json
|-- test
|   `-- report
|       |-- cucumber_report.json
|       `-- html
// and plenty of good html stuff
|           `-- index.html

Am I missing an option to remove it? I can delete it after the report is produced, but I expected an option should do that ...

1

There are 1 best solutions below

3
On BEST ANSWER

The messages (ndjson) report is implicitly generated, as the json and html report are products of it (think a function - messages goes in - json and html comes out). Hence, if either is enabled, then messages are too. You can control the location of this implicitly generated report the same way you do with the other types.

With the introduction of a more stateful backend in v17.0.0 however, one might think that the backend could contain this implicit state without touching the file system. I've put this on my todo-list.