lukejpreston / xunit-viewer

View your xunit results using JavaScript
MIT License
192 stars 43 forks source link

xunit-viewer "10.6.0"-Show Help is not a function #161

Open J-Ashraf opened 4 months ago

J-Ashraf commented 4 months ago

By executing npx command "npx xunit-viewer -r "test-reports/report.xml" -o test-reports/axecore-snapshot/storybook-test-report.html" I am getting the following error.:

showHelp() ^

TypeError: showHelp is not a function at default (file:///C:/dpl3-sb/node_modules/xunit-viewer/xunit-viewer.js:18:5) at file:///C:/dpl3-sb/node_modules/xunit-viewer/bin/xunit-viewer.js:6:1
at ModuleJob.run (node:internal/modules/esm/module_job:217:25) at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
at async loadESM (node:internal/process/esm_loader:34:7) at async handleMainPromise (node:internal/modules/run_main:66:12)

Node.js v20.9.0

CarstenLeue commented 2 months ago

The result of the dynamic import in https://github.com/lukejpreston/xunit-viewer/blob/master/xunit-viewer.js#L17 is a promise (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import#return_value)

So the import should be

const { showHelp } = await import('./src/cli/args.js')
khalilTN commented 1 week ago

Hello, any solution for this isue ?