'How to generate only test coverage from a specific folder with tests in Cypress

I was reading Cypress docs and noticed that Cypress can generate index.html file inside coverage/lcov-report/index.html. That file contains the information about test coverage from the entire application.
Inside cypress/ folder i have another folder called main.
Question: How to generate the coverage result only taking into account the tests from that folder? At the end when i will open index.html file i need to see only the coverage from main folder.
Who can help with that? Or probably is possible to configure nyc?



Solution 1:[1]

Add some configuration to nyc.config.js

Using include and exclude arrays

If there are paths specified in the include array, then the set of instrumented files will be limited to eligible files found in those paths. If the include array is left undefined all eligible files will be included, equivalent to setting include: ['**']. Multiple include globs can be specified on the command line, each must follow a --include, -n switch.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 SuchAnIgnorantThingToDo-UKR