I am using typescript with node js in my project and wants to know the code coverage. for code coverage i am using nyc.
When I write type:module
in the project's package.json file. and try to run mocha --require ts-node/register dist/__tests__/configure_command.test.ts
it is showing all the description of testcases with green characters but after it it is showing 0 passing and it is showing Unknown(0%) code coverage for the project.
When i remove type:module from the package.json file, then in every typescript file(.ts file) with await at the top without any async function is giving error, obviously it is the error for await without async function in the commonJs module.
I want the solution with all the files are ts files, I can do any other changes. Let me know if i remove type:module and then what should be the changes for the ts files having await at the top of the file without the async function.
Or If type:module
then what should be the additional configuration required in tsconfig or package.json or for nyc.