<CFParam>tags in your
/tests/runner.cfmfile. If you created a fresh new ColdBox app from our app templates using
coldbox create app, you'll see there are already configuration options ready for you to change. If you are working with an existing test suite runner, place the following lines PRIOR to the
<CFInclude>in your runner.cfm.
falseto enable the code coverage feature of TestBox. This setting will default to
trueif TestBox detects that you have FusionReactor installed,
falseotherwise. Setting this to
truewithout FusionReactor installed will be ignored.
/tests/Application.cfcto make the path dynamic. This is especially useful if the app being tested is in a subfolder of the actual web root. There is nominal overhead in gathering the coverage data from files, so set this to the correct folder and instead of using the whitelist to filter down from your web root if possible.
cfmso there's no need to filter additionally on that unless you want to only include, say,
coveragePathToCapturesetting that further filters what files and folders to track. By default this setting is empty, which means ALL CFML code in the coverage path will be tracked. As soon as you specify at least one file globbing path in the whitelist, ONLY the files matching the whitelist will be tracked.
?to match a single char like
*to match multiple characters within a folder or file like
**to match multiple characters in any sub folder (recursively) like
foowill match any file or folder recursively but a leading slash like
/foolocks that pattern to the root directory so it's not a recursive match.
/tests/, but no trailing slash like
/testswould also match a file such as
coveragePathToCapturesetting that is applied on top of any whitelist patterns to prune back folders or files you don't want to track. There's no reason to include a path in the blacklist if you have a whitelist specified and that whitelist already doesn't include the path in question. However, a blacklist can be very handy when you want to include everything but a few small exceptions and it's easier to list those exceptions rather than create a large number of paths in the whitelist.
/tests/results/coverageReportbut just remember to expand it so it's absolute. The directory will be created if it doesn't exist.