Test coverage for a custom test library (like postman) ?
See original GitHub issueHi, thanks for such a piece of work !
I didn’t really understood how to do that:
- I have a nodeJS process running on
localhost:9999
- I have a custom test library that are targeting routes of an express api (same behaviour than postman)
- I run my tests like
"nyc npm run test-api"
and test-api isnode -e 'require(
./core-scripts)(
run-tests)'
Here is my config:
module.exports = {
all: true,
include: ['**/server/**/*'],
exclude: ['*.spec.js'],
reporter: ['json-summary', 'text'],
'report-dir': './.jarvis'
};
And here is a sample of my report:
Can you help me understand why all is red and to 0 ?
Thanks for your lights 😃
EDIT: now I understand that it is not working because the server is not started with nyc
command. How may I do that ? And how to output the coverage report ?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
9 Best Code Coverage Tools for Java, Python, C, C++, C# ...
NET code coverage according to your customized needs; Helps you to test, track and manage a unified coverage number across entire teams ...
Read more >Writing tests
Tests confirm that your API is working as expected, that integrations ... Use snippets from the right pane to add a test or...
Read more >20 Most Popular Unit Testing Tools in 2023
List and comparison of the best Unit Testing Tools. Here is the list of top Unit Testing Frameworks used by developers to create...
Read more >API Testing: Approaches, Tools, and Frameworks
API testing kills bugs early in the development cycle. How to test APIs, which tool to use: Postman, Rest Assured, or jMeter, why...
Read more >Building A Scalable API Testing Framework With Jest And ...
Adding a new test requires editing in Postman, saving it in the ... test results; coverageDirectory: creates a custom directory for coverage reports ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi there, you should ask a developer to help you if you feel that you need to as it is not only about running a command (npx nyc instrument src instrumented --compact=false **** assuming that your source code is in the “src” folder and you want the output to be in the “instrumented folder”), but the application after that will need to be serving the instrumented folder which means it will have to run no the original source code but instrumented one … then you run your test against that and the report will be created
Glad it helped 😃