wikimedia / eslint-docgen

Automatically generate ESLint plugin documentation from rule metadata and test cases.
MIT License
10 stars 7 forks source link

Config error output swallowed in jest #125

Closed jpoehnelt closed 2 years ago

jpoehnelt commented 2 years ago

When using jest to run the tests I do not get any useful output from assertValidConfig:

process.exit called with "1"
  at assertValidConfig (node_modules/eslint-docgen/src/write-docs-from-tests.js:30:11)
  at Object.<anonymous> (node_modules/eslint-docgen/src/write-docs-from-tests.js:34:1)
  at Object.<anonymous> (node_modules/eslint-docgen/src/rule-tester.js:15:32)
jpoehnelt commented 2 years ago

Patching in

throw new Error([formatter.heading( configSource )].concat(configErrors.map( ( error ) => formatter.error( error ) )).join( '\n' ) );

worked for me. I'll look a little further and see about submitting a PR.

edg2s commented 2 years ago

Thanks! Sorry I missed this over the Christmas break...