Instrumentation inserts tracker lines into program code so statement execution can be observed during tests. In JavaScript coverage analysis, it forms the middle of a three-phase process: load source files, instrument the code, then connect test-runner hooks to report coverage. section 6.5
A coverage workflow proceeds by:
- Loading the source files. section 6.5
- Adding tracker lines to instrument the code. section 6.5
- Connecting test-runner hooks to output coverage details. section 6.5
Instrumenting a JavaScript file
A script include such as <script src="imperative-show-student-program.js" data-cover></script> marks a JavaScript program for coverage collection. Blanket.js can then report which statements ran during QUnit tests. section 6.5
<script src="imperative-show-student-program.js" data-cover></script>
View the script include that enables coverage instrumentation for the imperative example. section 6.5












