Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--ignore argument only excepts RegEx #136

Open
ckuepker opened this issue Feb 3, 2023 · 0 comments
Open

--ignore argument only excepts RegEx #136

ckuepker opened this issue Feb 3, 2023 · 0 comments
Labels

Comments

@ckuepker
Copy link

ckuepker commented Feb 3, 2023

Hello there,
we tried to exclude certain XML files from the xunit-viewer input via the --ignore argument. We need to exclude any file that ends on .coverage.xml. The documentation gives xunit-viewer -r folder -i *-broke.xml as an example which seems to fit our use case but if we try it that way we get the following exception:

`else if (file.endsWith('.xml') && !ignore.some(pattern => file.includes(pattern) || new RegExp(pattern).test(file))) files.push(file)
^

SyntaxError: Invalid regular expression: /*.coverage.xml/: Nothing to repeat
at new RegExp ()
at C:\git\ets\node_modules\xunit-viewer\src\cli\get-files.js:10:93
at Array.some ()
at C:\git\ets\node_modules\xunit-viewer\src\cli\get-files.js:10:51
at Array.forEach ()
at getFiles (C:\git\ets\node_modules\xunit-viewer\src\cli\get-files.js:8:8)
at module.exports (C:\git\ets\node_modules\xunit-viewer\src\cli\get-files.js:20:17)
at runXunitViewer (C:\git\ets\node_modules\xunit-viewer\xunit-viewer.js:25:19)
at module.exports (C:\git\ets\node_modules\xunit-viewer\xunit-viewer.js:38:52)
at Object. (C:\git\ets\node_modules\xunit-viewer\bin\xunit-viewer:6:1)`

We had to give a full RegEx (.+\.coverage\.xml) to bypass the check and I think this is not intended. Either the documentation or implementation require a change here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants