From 5eba77dac523d4a7dbb426bc364fde07a864f8e2 Mon Sep 17 00:00:00 2001
From: Brev Patterson <me@brev.name>
Date: Wed, 9 Feb 2022 13:06:42 -0800
Subject: [PATCH 1/6] Change the `--all` flag to cooperate with the new
 `--extension` flag. Instead of a few hard-coded extensions, `--all` will now
 respect any custom extensions.

Backwards compatible if `--extension` flag is not used.

New test added, snapshots updated, everything is passing.

As an example: I'm using esmodule loaders to have Node.js load `.svelte` files
(see: [esm-loader-svelte](https://github.com/brev/esm-loader-svelte)). This
works great with the `--extension` flag, but `--all` was missing this new
extension. With this changeset, everything now works great.
---
 lib/report.js                     |  3 +-
 test/fixtures/custom-ext2.special | 24 ++++++++++
 test/integration.js               | 15 ++++++
 test/integration.js.snap          | 78 +++++++++++++++++++++++++++++++
 4 files changed, 119 insertions(+), 1 deletion(-)
 create mode 100644 test/fixtures/custom-ext2.special

diff --git a/lib/report.js b/lib/report.js
index 17485e25..d86cc611 100644
--- a/lib/report.js
+++ b/lib/report.js
@@ -190,12 +190,13 @@ class Report {
         result: emptyReports
       })
       const workingDirs = this.src
+      const { extension } = this.exclude
       for (const workingDir of workingDirs) {
         this.exclude.globSync(workingDir).forEach((f) => {
           const fullPath = resolve(workingDir, f)
           if (!fileIndex.has(fullPath)) {
             const ext = extname(fullPath)
-            if (ext === '.js' || ext === '.ts' || ext === '.mjs') {
+            if (extension.includes(ext)) {
               const stat = statSync(fullPath)
               const sourceMap = getSourceMapFromFile(fullPath)
               if (sourceMap) {
diff --git a/test/fixtures/custom-ext2.special b/test/fixtures/custom-ext2.special
new file mode 100644
index 00000000..6b407dea
--- /dev/null
+++ b/test/fixtures/custom-ext2.special
@@ -0,0 +1,24 @@
+require('./async')
+
+console.info('i am a line of code 2')
+
+function apple (awesome) {
+  if (false || true) {
+    console.info('what2')
+  }
+  if (true || false) {
+    console.log('hey2')
+  }
+}
+
+function missed () {
+  
+}
+
+function missed2 () {
+  
+}
+
+apple()
+apple()
+apple()
diff --git a/test/integration.js b/test/integration.js
index ee5ad0e4..a5cf9430 100644
--- a/test/integration.js
+++ b/test/integration.js
@@ -645,5 +645,20 @@ describe('c8', () => {
       ])
       output.toString('utf8').should.matchSnapshot()
     })
+
+    it('includes coverage when extensions specified with --all', () => {
+      const { output } = spawnSync(nodePath, [
+        c8Path,
+        '--all',
+        '--exclude="test/*.js"',
+        '--extension=.js',
+        '--extension=.special',
+        '--temp-directory=tmp/extension',
+        '--clean=false',
+        nodePath,
+        require.resolve('./fixtures/custom-ext.special')
+      ])
+      output.toString('utf8').should.matchSnapshot()
+    })
   })
 })
diff --git a/test/integration.js.snap b/test/integration.js.snap
index ef03cc73..071a30c8 100644
--- a/test/integration.js.snap
+++ b/test/integration.js.snap
@@ -144,6 +144,84 @@ All files           |   83.33 |    85.71 |      60 |   83.33 |
 ,"
 `;
 
+exports[`c8 --extension includes coverage when extensions specified with --all 1`] = `
+",hey
+i am a line of code
+what
+hey
+what
+hey
+what
+hey
+---------------------------------------|---------|----------|---------|---------|-------------------
+File                                   | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
+---------------------------------------|---------|----------|---------|---------|-------------------
+All files                              |    1.98 |       12 |    6.25 |    1.98 |                   
+ c8                                    |       0 |        0 |       0 |       0 |                   
+  index.js                             |       0 |        0 |       0 |       0 | 1                 
+ c8/bin                                |       0 |        0 |       0 |       0 |                   
+  c8.js                                |       0 |        0 |       0 |       0 | 1-52              
+ c8/coverage                           |       0 |        0 |       0 |       0 |                   
+  block-navigation.js                  |       0 |        0 |       0 |       0 | 1-79              
+  prettify.js                          |       0 |        0 |       0 |       0 | 1-2               
+  sorter.js                            |       0 |        0 |       0 |       0 | 1-170             
+ c8/lib                                |       0 |        0 |       0 |       0 |                   
+  is-cjs-esm-bridge.js                 |       0 |        0 |       0 |       0 | 1-10              
+  parse-args.js                        |       0 |        0 |       0 |       0 | 1-218             
+  report.js                            |       0 |        0 |       0 |       0 | 1-319             
+  source-map-from-file.js              |       0 |        0 |       0 |       0 | 1-100             
+ c8/lib/commands                       |       0 |        0 |       0 |       0 |                   
+  check-coverage.js                    |       0 |        0 |       0 |       0 | 1-70              
+  report.js                            |       0 |        0 |       0 |       0 | 1-41              
+ c8/test/fixtures                      |   15.95 |    35.29 |      20 |   15.95 |                   
+  async.js                             |     100 |      100 |     100 |     100 |                   
+  c8-ignore-next.js                    |       0 |        0 |       0 |       0 | 1-22              
+  c8-ignore-start-stop.js              |       0 |        0 |       0 |       0 | 1-21              
+  computed-method.js                   |       0 |        0 |       0 |       0 | 1-15              
+  custom-ext.special                   |      75 |    66.66 |   33.33 |      75 | 14-16,18-20       
+  custom-ext2.special                  |       0 |        0 |       0 |       0 | 1-24              
+  disable-fs-promises.js               |       0 |        0 |       0 |       0 | 1-4               
+  issue-254.js                         |       0 |        0 |       0 |       0 | 1-7               
+  multiple-spawn.js                    |       0 |        0 |       0 |       0 | 1-12              
+  normal.js                            |       0 |        0 |       0 |       0 | 1-24              
+  shebang.js                           |       0 |        0 |       0 |       0 | 1-8               
+  subprocess.js                        |       0 |        0 |       0 |       0 | 1-15              
+ c8/test/fixtures/all/ts-compiled      |       0 |        0 |       0 |       0 |                   
+  loaded.ts                            |       0 |        0 |       0 |       0 | 1-19              
+  main.ts                              |       0 |        0 |       0 |       0 | 1-4               
+ c8/test/fixtures/all/ts-compiled/dir  |       0 |        0 |       0 |       0 |                   
+  unloaded.ts                          |       0 |        0 |       0 |       0 | 1-5               
+ c8/test/fixtures/all/vanilla          |       0 |        0 |       0 |       0 |                   
+  loaded.js                            |       0 |        0 |       0 |       0 | 1-19              
+  main.js                              |       0 |        0 |       0 |       0 | 1-4               
+ c8/test/fixtures/all/vanilla/dir      |       0 |        0 |       0 |       0 |                   
+  unloaded.js                          |       0 |        0 |       0 |       0 | 1-5               
+ c8/test/fixtures/multidir1            |       0 |        0 |       0 |       0 |                   
+  file1.js                             |       0 |        0 |       0 |       0 | 1                 
+ c8/test/fixtures/multidir2            |       0 |        0 |       0 |       0 |                   
+  file2.js                             |       0 |        0 |       0 |       0 | 1                 
+ c8/test/fixtures/report               |       0 |        0 |       0 |       0 |                   
+  allowExternal.js                     |       0 |        0 |       0 |       0 | 1                 
+  report-multi-dir-external.js         |       0 |        0 |       0 |       0 | 1-12              
+  report-single-dir-external.js        |       0 |        0 |       0 |       0 | 1-12              
+  srcOverride.js                       |       0 |        0 |       0 |       0 | 1                 
+ c8/test/fixtures/source-maps          |       0 |        0 |       0 |       0 |                   
+  branches.js                          |       0 |        0 |       0 |       0 | 1-20              
+  fake-source-map.js                   |       0 |        0 |       0 |       0 | 1-7               
+ c8/test/fixtures/source-maps/branches |       0 |        0 |       0 |       0 |                   
+  branch-1.js                          |       0 |        0 |       0 |       0 | 1-12              
+  branch-2.js                          |       0 |        0 |       0 |       0 | 1-9               
+  branches.js                          |       0 |        0 |       0 |       0 | 1-20              
+  branches.typescript.ts               |       0 |        0 |       0 |       0 | 1-25              
+ c8/test/fixtures/source-maps/classes  |       0 |        0 |       0 |       0 |                   
+  class-1.js                           |       0 |        0 |       0 |       0 | 1-5               
+  class-2.js                           |       0 |        0 |       0 |       0 | 1-23              
+  classes.js                           |       0 |        0 |       0 |       0 | 1-27              
+  classes.typescript.ts                |       0 |        0 |       0 |       0 | 1-33              
+---------------------------------------|---------|----------|---------|---------|-------------------
+,"
+`;
+
 exports[`c8 ESM Modules collects coverage for ESM modules 1`] = `
 ",bar foo
 ------------|---------|----------|---------|---------|-------------------

From a7b840dc58a329ce319114c8088a2d50042097dd Mon Sep 17 00:00:00 2001
From: "bencoe@google.com" <bencoe@google.com>
Date: Mon, 16 May 2022 00:10:20 +0000
Subject: [PATCH 2/6] chore: resolve conflict

---
 test/integration.js_10.snap | 116 ++++++++++++++++++++++++++++++------
 1 file changed, 97 insertions(+), 19 deletions(-)

diff --git a/test/integration.js_10.snap b/test/integration.js_10.snap
index dca7c5de..27c673a4 100644
--- a/test/integration.js_10.snap
+++ b/test/integration.js_10.snap
@@ -144,6 +144,84 @@ All files           |   83.33 |    85.71 |   66.66 |   83.33 |
 ,"
 `;
 
+exports[`c8 --extension includes coverage when extensions specified with --all 1`] = `
+",hey
+i am a line of code
+what
+hey
+what
+hey
+what
+hey
+---------------------------------------|---------|----------|---------|---------|-----------------------------------------------------------------------------------------------------------
+File                                   | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                                                                                         
+---------------------------------------|---------|----------|---------|---------|-----------------------------------------------------------------------------------------------------------
+All files                              |   40.77 |    41.32 |   33.76 |   40.77 |                                                                                                           
+ c8                                    |       0 |        0 |       0 |       0 |                                                                                                           
+  index.js                             |       0 |        0 |       0 |       0 | 1                                                                                                         
+ c8/bin                                |   78.84 |       60 |   66.66 |   78.84 |                                                                                                           
+  c8.js                                |   78.84 |       60 |   66.66 |   78.84 | 22,27-29,32-33,41-43,50-51                                                                                
+ c8/coverage                           |       0 |        0 |       0 |       0 |                                                                                                           
+  block-navigation.js                  |       0 |        0 |       0 |       0 | 1-87                                                                                                      
+  prettify.js                          |       0 |        0 |       0 |       0 | 1-2                                                                                                       
+  sorter.js                            |       0 |        0 |       0 |       0 | 1-196                                                                                                     
+ c8/lib                                |   78.49 |    54.23 |   73.07 |   78.49 |                                                                                                           
+  is-cjs-esm-bridge.js                 |      90 |       25 |     100 |      90 | 9                                                                                                         
+  parse-args.js                        |   97.24 |    58.33 |     100 |   97.24 | 159-160,181-182,195-196                                                                                   
+  report.js                            |   75.96 |    57.89 |      80 |   75.96 | 58,60,100-101,106,112-115,121-122,126-130,149-161,181-182,188-222,252-253,280-281,287-289,310-315,326-327 
+  source-map-from-file.js              |      45 |      100 |       0 |      45 | 39-50,52-67,69-77,81-98                                                                                   
+ c8/lib/commands                       |   41.44 |    66.66 |   16.66 |   41.44 |                                                                                                           
+  check-coverage.js                    |   18.57 |      100 |       0 |   18.57 | 9-11,14-36,39-53,55-70                                                                                    
+  report.js                            |   80.48 |     62.5 |      50 |   80.48 | 9-10,15-20                                                                                                
+ c8/test/fixtures                      |   15.95 |    35.29 |      25 |   15.95 |                                                                                                           
+  async.js                             |     100 |      100 |     100 |     100 |                                                                                                           
+  c8-ignore-next.js                    |       0 |        0 |       0 |       0 | 1-22                                                                                                      
+  c8-ignore-start-stop.js              |       0 |        0 |       0 |       0 | 1-21                                                                                                      
+  computed-method.js                   |       0 |        0 |       0 |       0 | 1-15                                                                                                      
+  custom-ext.special                   |      75 |    66.66 |   33.33 |      75 | 14-16,18-20                                                                                               
+  custom-ext2.special                  |       0 |        0 |       0 |       0 | 1-24                                                                                                      
+  disable-fs-promises.js               |       0 |        0 |       0 |       0 | 1-4                                                                                                       
+  issue-254.js                         |       0 |        0 |       0 |       0 | 1-7                                                                                                       
+  multiple-spawn.js                    |       0 |        0 |       0 |       0 | 1-12                                                                                                      
+  normal.js                            |       0 |        0 |       0 |       0 | 1-24                                                                                                      
+  shebang.js                           |       0 |        0 |       0 |       0 | 1-8                                                                                                       
+  subprocess.js                        |       0 |        0 |       0 |       0 | 1-15                                                                                                      
+ c8/test/fixtures/all/ts-compiled      |       0 |        0 |       0 |       0 |                                                                                                           
+  loaded.ts                            |       0 |        0 |       0 |       0 | 1-19                                                                                                      
+  main.ts                              |       0 |        0 |       0 |       0 | 1-4                                                                                                       
+ c8/test/fixtures/all/ts-compiled/dir  |       0 |        0 |       0 |       0 |                                                                                                           
+  unloaded.ts                          |       0 |        0 |       0 |       0 | 1-5                                                                                                       
+ c8/test/fixtures/all/vanilla          |       0 |        0 |       0 |       0 |                                                                                                           
+  loaded.js                            |       0 |        0 |       0 |       0 | 1-19                                                                                                      
+  main.js                              |       0 |        0 |       0 |       0 | 1-4                                                                                                       
+ c8/test/fixtures/all/vanilla/dir      |       0 |        0 |       0 |       0 |                                                                                                           
+  unloaded.js                          |       0 |        0 |       0 |       0 | 1-5                                                                                                       
+ c8/test/fixtures/multidir1            |       0 |        0 |       0 |       0 |                                                                                                           
+  file1.js                             |       0 |        0 |       0 |       0 | 1                                                                                                         
+ c8/test/fixtures/multidir2            |       0 |        0 |       0 |       0 |                                                                                                           
+  file2.js                             |       0 |        0 |       0 |       0 | 1                                                                                                         
+ c8/test/fixtures/report               |       0 |        0 |       0 |       0 |                                                                                                           
+  allowExternal.js                     |       0 |        0 |       0 |       0 | 1                                                                                                         
+  report-multi-dir-external.js         |       0 |        0 |       0 |       0 | 1-12                                                                                                      
+  report-single-dir-external.js        |       0 |        0 |       0 |       0 | 1-12                                                                                                      
+  srcOverride.js                       |       0 |        0 |       0 |       0 | 1                                                                                                         
+ c8/test/fixtures/source-maps          |       0 |        0 |       0 |       0 |                                                                                                           
+  branches.js                          |       0 |        0 |       0 |       0 | 1-20                                                                                                      
+  fake-source-map.js                   |       0 |        0 |       0 |       0 | 1-7                                                                                                       
+ c8/test/fixtures/source-maps/branches |       0 |        0 |       0 |       0 |                                                                                                           
+  branch-1.js                          |       0 |        0 |       0 |       0 | 1-12                                                                                                      
+  branch-2.js                          |       0 |        0 |       0 |       0 | 1-9                                                                                                       
+  branches.js                          |       0 |        0 |       0 |       0 | 1-20                                                                                                      
+  branches.typescript.ts               |       0 |        0 |       0 |       0 | 1-25                                                                                                      
+ c8/test/fixtures/source-maps/classes  |       0 |        0 |       0 |       0 |                                                                                                           
+  class-1.js                           |       0 |        0 |       0 |       0 | 1-5                                                                                                       
+  class-2.js                           |       0 |        0 |       0 |       0 | 1-23                                                                                                      
+  classes.js                           |       0 |        0 |       0 |       0 | 1-27                                                                                                      
+  classes.typescript.ts                |       0 |        0 |       0 |       0 | 1-33                                                                                                      
+---------------------------------------|---------|----------|---------|---------|-----------------------------------------------------------------------------------------------------------
+,"
+`;
+
 exports[`c8 check-coverage --100 1`] = `
 ",hey
 i am a line of code
@@ -179,13 +257,13 @@ hey
 --------------------------|---------|----------|---------|---------|--------------------------------
 File                      | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s              
 --------------------------|---------|----------|---------|---------|--------------------------------
-All files                 |   74.04 |    58.82 |   63.41 |   74.04 |                                
+All files                 |   73.95 |    58.82 |   63.41 |   73.95 |                                
  bin                      |   78.84 |       60 |   66.66 |   78.84 |                                
   c8.js                   |   78.84 |       60 |   66.66 |   78.84 | 22,27-29,32-33,41-43,50-51     
- lib                      |   78.61 |    54.23 |   73.07 |   78.61 |                                
+ lib                      |   78.49 |    54.23 |   73.07 |   78.49 |                                
   is-cjs-esm-bridge.js    |      90 |       25 |     100 |      90 | 9                              
   parse-args.js           |   97.24 |    58.33 |     100 |   97.24 | 159-160,181-182,195-196        
-  report.js               |   76.19 |    57.89 |      80 |   76.19 | ...280,286-288,309-314,325-326 
+  report.js               |   75.96 |    57.89 |      80 |   75.96 | ...281,287-289,310-315,326-327 
   source-map-from-file.js |      45 |      100 |       0 |      45 | 39-50,52-67,69-77,81-98        
  lib/commands             |   41.44 |    66.66 |   16.66 |   41.44 |                                
   check-coverage.js       |   18.57 |      100 |       0 |   18.57 | 9-11,14-36,39-53,55-70         
@@ -194,9 +272,9 @@ All files                 |   74.04 |    58.82 |   63.41 |   74.04 |
   async.js                |     100 |      100 |     100 |     100 |                                
   normal.js               |      75 |    66.66 |   33.33 |      75 | 14-16,18-20                    
 --------------------------|---------|----------|---------|---------|--------------------------------
-,ERROR: Coverage for lines (74.04%) does not meet global threshold (101%)
+,ERROR: Coverage for lines (73.95%) does not meet global threshold (101%)
 ERROR: Coverage for branches (58.82%) does not meet global threshold (82%)
-ERROR: Coverage for statements (74.04%) does not meet global threshold (95%)
+ERROR: Coverage for statements (73.95%) does not meet global threshold (95%)
 "
 `;
 
@@ -214,9 +292,9 @@ ERROR: Coverage for branches (25%) does not meet threshold (82%) for lib/is-cjs-
 ERROR: Coverage for statements (90%) does not meet threshold (95%) for lib/is-cjs-esm-bridge.js
 ERROR: Coverage for lines (97.24%) does not meet threshold (101%) for lib/parse-args.js
 ERROR: Coverage for branches (58.33%) does not meet threshold (82%) for lib/parse-args.js
-ERROR: Coverage for lines (76.19%) does not meet threshold (101%) for lib/report.js
+ERROR: Coverage for lines (75.96%) does not meet threshold (101%) for lib/report.js
 ERROR: Coverage for branches (57.89%) does not meet threshold (82%) for lib/report.js
-ERROR: Coverage for statements (76.19%) does not meet threshold (95%) for lib/report.js
+ERROR: Coverage for statements (75.96%) does not meet threshold (95%) for lib/report.js
 ERROR: Coverage for lines (45%) does not meet threshold (101%) for lib/source-map-from-file.js
 ERROR: Coverage for statements (45%) does not meet threshold (95%) for lib/source-map-from-file.js
 ERROR: Coverage for lines (100%) does not meet threshold (101%) for test/fixtures/async.js
@@ -227,19 +305,19 @@ ERROR: Coverage for statements (75%) does not meet threshold (95%) for test/fixt
 `;
 
 exports[`c8 check-coverage check-coverage command with --100 1`] = `
-",,ERROR: Coverage for lines (77.75%) does not meet global threshold (100%)
+",,ERROR: Coverage for lines (77.66%) does not meet global threshold (100%)
 ERROR: Coverage for functions (67.44%) does not meet global threshold (100%)
 ERROR: Coverage for branches (62.06%) does not meet global threshold (100%)
-ERROR: Coverage for statements (77.75%) does not meet global threshold (100%)
+ERROR: Coverage for statements (77.66%) does not meet global threshold (100%)
 "
 `;
 
 exports[`c8 check-coverage exits with 0 if coverage within threshold 1`] = `",,"`;
 
 exports[`c8 check-coverage exits with 1 if coverage is below threshold 1`] = `
-",,ERROR: Coverage for lines (74.04%) does not meet global threshold (101%)
+",,ERROR: Coverage for lines (73.95%) does not meet global threshold (101%)
 ERROR: Coverage for branches (58.82%) does not meet global threshold (82%)
-ERROR: Coverage for statements (74.04%) does not meet global threshold (95%)
+ERROR: Coverage for statements (73.95%) does not meet global threshold (95%)
 "
 `;
 
@@ -326,13 +404,13 @@ exports[`c8 report generates report from existing temporary files 1`] = `
 ",--------------------------|---------|----------|---------|---------|--------------------------------
 File                      | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s              
 --------------------------|---------|----------|---------|---------|--------------------------------
-All files                 |   74.04 |    58.82 |   63.41 |   74.04 |                                
+All files                 |   73.95 |    58.82 |   63.41 |   73.95 |                                
  bin                      |   78.84 |       60 |   66.66 |   78.84 |                                
   c8.js                   |   78.84 |       60 |   66.66 |   78.84 | 22,27-29,32-33,41-43,50-51     
- lib                      |   78.61 |    54.23 |   73.07 |   78.61 |                                
+ lib                      |   78.49 |    54.23 |   73.07 |   78.49 |                                
   is-cjs-esm-bridge.js    |      90 |       25 |     100 |      90 | 9                              
   parse-args.js           |   97.24 |    58.33 |     100 |   97.24 | 159-160,181-182,195-196        
-  report.js               |   76.19 |    57.89 |      80 |   76.19 | ...280,286-288,309-314,325-326 
+  report.js               |   75.96 |    57.89 |      80 |   75.96 | ...281,287-289,310-315,326-327 
   source-map-from-file.js |      45 |      100 |       0 |      45 | 39-50,52-67,69-77,81-98        
  lib/commands             |   41.44 |    66.66 |   16.66 |   41.44 |                                
   check-coverage.js       |   18.57 |      100 |       0 |   18.57 | 9-11,14-36,39-53,55-70         
@@ -348,13 +426,13 @@ exports[`c8 report supports --check-coverage, when generating reports 1`] = `
 ",--------------------------|---------|----------|---------|---------|--------------------------------
 File                      | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s              
 --------------------------|---------|----------|---------|---------|--------------------------------
-All files                 |   74.04 |    58.82 |   63.41 |   74.04 |                                
+All files                 |   73.95 |    58.82 |   63.41 |   73.95 |                                
  bin                      |   78.84 |       60 |   66.66 |   78.84 |                                
   c8.js                   |   78.84 |       60 |   66.66 |   78.84 | 22,27-29,32-33,41-43,50-51     
- lib                      |   78.61 |    54.23 |   73.07 |   78.61 |                                
+ lib                      |   78.49 |    54.23 |   73.07 |   78.49 |                                
   is-cjs-esm-bridge.js    |      90 |       25 |     100 |      90 | 9                              
   parse-args.js           |   97.24 |    58.33 |     100 |   97.24 | 159-160,181-182,195-196        
-  report.js               |   76.19 |    57.89 |      80 |   76.19 | ...280,286-288,309-314,325-326 
+  report.js               |   75.96 |    57.89 |      80 |   75.96 | ...281,287-289,310-315,326-327 
   source-map-from-file.js |      45 |      100 |       0 |      45 | 39-50,52-67,69-77,81-98        
  lib/commands             |   41.44 |    66.66 |   16.66 |   41.44 |                                
   check-coverage.js       |   18.57 |      100 |       0 |   18.57 | 9-11,14-36,39-53,55-70         
@@ -363,9 +441,9 @@ All files                 |   74.04 |    58.82 |   63.41 |   74.04 |
   async.js                |     100 |      100 |     100 |     100 |                                
   normal.js               |      75 |    66.66 |   33.33 |      75 | 14-16,18-20                    
 --------------------------|---------|----------|---------|---------|--------------------------------
-,ERROR: Coverage for lines (74.04%) does not meet global threshold (101%)
+,ERROR: Coverage for lines (73.95%) does not meet global threshold (101%)
 ERROR: Coverage for branches (58.82%) does not meet global threshold (82%)
-ERROR: Coverage for statements (74.04%) does not meet global threshold (95%)
+ERROR: Coverage for statements (73.95%) does not meet global threshold (95%)
 "
 `;
 

From 7fa1f774411d2d29c6e5ab615ffdb8a46b48ed50 Mon Sep 17 00:00:00 2001
From: "Benjamin E. Coe" <bencoe@google.com>
Date: Wed, 23 Mar 2022 18:20:31 +0000
Subject: [PATCH 3/6] Update test/integration.js

---
 test/integration.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/integration.js b/test/integration.js
index a5cf9430..7ae8f513 100644
--- a/test/integration.js
+++ b/test/integration.js
@@ -654,7 +654,7 @@ describe('c8', () => {
         '--extension=.js',
         '--extension=.special',
         '--temp-directory=tmp/extension',
-        '--clean=false',
+        '--clean=true',
         nodePath,
         require.resolve('./fixtures/custom-ext.special')
       ])

From 72a5781a5a5a45c2688369e7555e956d22856558 Mon Sep 17 00:00:00 2001
From: Brev Patterson <me@brev.name>
Date: Mon, 28 Mar 2022 18:37:54 -0700
Subject: [PATCH 4/6] Re-run snapshots with `--clean=true`.

---
 test/integration.js_10.snap | 132 ++++++++++++++++++------------------
 1 file changed, 66 insertions(+), 66 deletions(-)

diff --git a/test/integration.js_10.snap b/test/integration.js_10.snap
index 27c673a4..9ec617bf 100644
--- a/test/integration.js_10.snap
+++ b/test/integration.js_10.snap
@@ -153,72 +153,72 @@ what
 hey
 what
 hey
----------------------------------------|---------|----------|---------|---------|-----------------------------------------------------------------------------------------------------------
-File                                   | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                                                                                         
----------------------------------------|---------|----------|---------|---------|-----------------------------------------------------------------------------------------------------------
-All files                              |   40.77 |    41.32 |   33.76 |   40.77 |                                                                                                           
- c8                                    |       0 |        0 |       0 |       0 |                                                                                                           
-  index.js                             |       0 |        0 |       0 |       0 | 1                                                                                                         
- c8/bin                                |   78.84 |       60 |   66.66 |   78.84 |                                                                                                           
-  c8.js                                |   78.84 |       60 |   66.66 |   78.84 | 22,27-29,32-33,41-43,50-51                                                                                
- c8/coverage                           |       0 |        0 |       0 |       0 |                                                                                                           
-  block-navigation.js                  |       0 |        0 |       0 |       0 | 1-87                                                                                                      
-  prettify.js                          |       0 |        0 |       0 |       0 | 1-2                                                                                                       
-  sorter.js                            |       0 |        0 |       0 |       0 | 1-196                                                                                                     
- c8/lib                                |   78.49 |    54.23 |   73.07 |   78.49 |                                                                                                           
-  is-cjs-esm-bridge.js                 |      90 |       25 |     100 |      90 | 9                                                                                                         
-  parse-args.js                        |   97.24 |    58.33 |     100 |   97.24 | 159-160,181-182,195-196                                                                                   
-  report.js                            |   75.96 |    57.89 |      80 |   75.96 | 58,60,100-101,106,112-115,121-122,126-130,149-161,181-182,188-222,252-253,280-281,287-289,310-315,326-327 
-  source-map-from-file.js              |      45 |      100 |       0 |      45 | 39-50,52-67,69-77,81-98                                                                                   
- c8/lib/commands                       |   41.44 |    66.66 |   16.66 |   41.44 |                                                                                                           
-  check-coverage.js                    |   18.57 |      100 |       0 |   18.57 | 9-11,14-36,39-53,55-70                                                                                    
-  report.js                            |   80.48 |     62.5 |      50 |   80.48 | 9-10,15-20                                                                                                
- c8/test/fixtures                      |   15.95 |    35.29 |      25 |   15.95 |                                                                                                           
-  async.js                             |     100 |      100 |     100 |     100 |                                                                                                           
-  c8-ignore-next.js                    |       0 |        0 |       0 |       0 | 1-22                                                                                                      
-  c8-ignore-start-stop.js              |       0 |        0 |       0 |       0 | 1-21                                                                                                      
-  computed-method.js                   |       0 |        0 |       0 |       0 | 1-15                                                                                                      
-  custom-ext.special                   |      75 |    66.66 |   33.33 |      75 | 14-16,18-20                                                                                               
-  custom-ext2.special                  |       0 |        0 |       0 |       0 | 1-24                                                                                                      
-  disable-fs-promises.js               |       0 |        0 |       0 |       0 | 1-4                                                                                                       
-  issue-254.js                         |       0 |        0 |       0 |       0 | 1-7                                                                                                       
-  multiple-spawn.js                    |       0 |        0 |       0 |       0 | 1-12                                                                                                      
-  normal.js                            |       0 |        0 |       0 |       0 | 1-24                                                                                                      
-  shebang.js                           |       0 |        0 |       0 |       0 | 1-8                                                                                                       
-  subprocess.js                        |       0 |        0 |       0 |       0 | 1-15                                                                                                      
- c8/test/fixtures/all/ts-compiled      |       0 |        0 |       0 |       0 |                                                                                                           
-  loaded.ts                            |       0 |        0 |       0 |       0 | 1-19                                                                                                      
-  main.ts                              |       0 |        0 |       0 |       0 | 1-4                                                                                                       
- c8/test/fixtures/all/ts-compiled/dir  |       0 |        0 |       0 |       0 |                                                                                                           
-  unloaded.ts                          |       0 |        0 |       0 |       0 | 1-5                                                                                                       
- c8/test/fixtures/all/vanilla          |       0 |        0 |       0 |       0 |                                                                                                           
-  loaded.js                            |       0 |        0 |       0 |       0 | 1-19                                                                                                      
-  main.js                              |       0 |        0 |       0 |       0 | 1-4                                                                                                       
- c8/test/fixtures/all/vanilla/dir      |       0 |        0 |       0 |       0 |                                                                                                           
-  unloaded.js                          |       0 |        0 |       0 |       0 | 1-5                                                                                                       
- c8/test/fixtures/multidir1            |       0 |        0 |       0 |       0 |                                                                                                           
-  file1.js                             |       0 |        0 |       0 |       0 | 1                                                                                                         
- c8/test/fixtures/multidir2            |       0 |        0 |       0 |       0 |                                                                                                           
-  file2.js                             |       0 |        0 |       0 |       0 | 1                                                                                                         
- c8/test/fixtures/report               |       0 |        0 |       0 |       0 |                                                                                                           
-  allowExternal.js                     |       0 |        0 |       0 |       0 | 1                                                                                                         
-  report-multi-dir-external.js         |       0 |        0 |       0 |       0 | 1-12                                                                                                      
-  report-single-dir-external.js        |       0 |        0 |       0 |       0 | 1-12                                                                                                      
-  srcOverride.js                       |       0 |        0 |       0 |       0 | 1                                                                                                         
- c8/test/fixtures/source-maps          |       0 |        0 |       0 |       0 |                                                                                                           
-  branches.js                          |       0 |        0 |       0 |       0 | 1-20                                                                                                      
-  fake-source-map.js                   |       0 |        0 |       0 |       0 | 1-7                                                                                                       
- c8/test/fixtures/source-maps/branches |       0 |        0 |       0 |       0 |                                                                                                           
-  branch-1.js                          |       0 |        0 |       0 |       0 | 1-12                                                                                                      
-  branch-2.js                          |       0 |        0 |       0 |       0 | 1-9                                                                                                       
-  branches.js                          |       0 |        0 |       0 |       0 | 1-20                                                                                                      
-  branches.typescript.ts               |       0 |        0 |       0 |       0 | 1-25                                                                                                      
- c8/test/fixtures/source-maps/classes  |       0 |        0 |       0 |       0 |                                                                                                           
-  class-1.js                           |       0 |        0 |       0 |       0 | 1-5                                                                                                       
-  class-2.js                           |       0 |        0 |       0 |       0 | 1-23                                                                                                      
-  classes.js                           |       0 |        0 |       0 |       0 | 1-27                                                                                                      
-  classes.typescript.ts                |       0 |        0 |       0 |       0 | 1-33                                                                                                      
----------------------------------------|---------|----------|---------|---------|-----------------------------------------------------------------------------------------------------------
+---------------------------------------|---------|----------|---------|---------|-------------------
+File                                   | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
+---------------------------------------|---------|----------|---------|---------|-------------------
+All files                              |    1.91 |       12 |    8.16 |    1.91 |                   
+ c8                                    |       0 |        0 |       0 |       0 |                   
+  index.js                             |       0 |        0 |       0 |       0 | 1                 
+ c8/bin                                |       0 |        0 |       0 |       0 |                   
+  c8.js                                |       0 |        0 |       0 |       0 | 1-52              
+ c8/coverage                           |       0 |        0 |       0 |       0 |                   
+  block-navigation.js                  |       0 |        0 |       0 |       0 | 1-87              
+  prettify.js                          |       0 |        0 |       0 |       0 | 1-2               
+  sorter.js                            |       0 |        0 |       0 |       0 | 1-196             
+ c8/lib                                |       0 |        0 |       0 |       0 |                   
+  is-cjs-esm-bridge.js                 |       0 |        0 |       0 |       0 | 1-10              
+  parse-args.js                        |       0 |        0 |       0 |       0 | 1-218             
+  report.js                            |       0 |        0 |       0 |       0 | 1-337             
+  source-map-from-file.js              |       0 |        0 |       0 |       0 | 1-100             
+ c8/lib/commands                       |       0 |        0 |       0 |       0 |                   
+  check-coverage.js                    |       0 |        0 |       0 |       0 | 1-70              
+  report.js                            |       0 |        0 |       0 |       0 | 1-41              
+ c8/test/fixtures                      |   15.95 |    35.29 |      25 |   15.95 |                   
+  async.js                             |     100 |      100 |     100 |     100 |                   
+  c8-ignore-next.js                    |       0 |        0 |       0 |       0 | 1-22              
+  c8-ignore-start-stop.js              |       0 |        0 |       0 |       0 | 1-21              
+  computed-method.js                   |       0 |        0 |       0 |       0 | 1-15              
+  custom-ext.special                   |      75 |    66.66 |   33.33 |      75 | 14-16,18-20       
+  custom-ext2.special                  |       0 |        0 |       0 |       0 | 1-24              
+  disable-fs-promises.js               |       0 |        0 |       0 |       0 | 1-4               
+  issue-254.js                         |       0 |        0 |       0 |       0 | 1-7               
+  multiple-spawn.js                    |       0 |        0 |       0 |       0 | 1-12              
+  normal.js                            |       0 |        0 |       0 |       0 | 1-24              
+  shebang.js                           |       0 |        0 |       0 |       0 | 1-8               
+  subprocess.js                        |       0 |        0 |       0 |       0 | 1-15              
+ c8/test/fixtures/all/ts-compiled      |       0 |        0 |       0 |       0 |                   
+  loaded.ts                            |       0 |        0 |       0 |       0 | 1-19              
+  main.ts                              |       0 |        0 |       0 |       0 | 1-4               
+ c8/test/fixtures/all/ts-compiled/dir  |       0 |        0 |       0 |       0 |                   
+  unloaded.ts                          |       0 |        0 |       0 |       0 | 1-5               
+ c8/test/fixtures/all/vanilla          |       0 |        0 |       0 |       0 |                   
+  loaded.js                            |       0 |        0 |       0 |       0 | 1-19              
+  main.js                              |       0 |        0 |       0 |       0 | 1-4               
+ c8/test/fixtures/all/vanilla/dir      |       0 |        0 |       0 |       0 |                   
+  unloaded.js                          |       0 |        0 |       0 |       0 | 1-5               
+ c8/test/fixtures/multidir1            |       0 |        0 |       0 |       0 |                   
+  file1.js                             |       0 |        0 |       0 |       0 | 1                 
+ c8/test/fixtures/multidir2            |       0 |        0 |       0 |       0 |                   
+  file2.js                             |       0 |        0 |       0 |       0 | 1                 
+ c8/test/fixtures/report               |       0 |        0 |       0 |       0 |                   
+  allowExternal.js                     |       0 |        0 |       0 |       0 | 1                 
+  report-multi-dir-external.js         |       0 |        0 |       0 |       0 | 1-12              
+  report-single-dir-external.js        |       0 |        0 |       0 |       0 | 1-12              
+  srcOverride.js                       |       0 |        0 |       0 |       0 | 1                 
+ c8/test/fixtures/source-maps          |       0 |        0 |       0 |       0 |                   
+  branches.js                          |       0 |        0 |       0 |       0 | 1-20              
+  fake-source-map.js                   |       0 |        0 |       0 |       0 | 1-7               
+ c8/test/fixtures/source-maps/branches |       0 |        0 |       0 |       0 |                   
+  branch-1.js                          |       0 |        0 |       0 |       0 | 1-12              
+  branch-2.js                          |       0 |        0 |       0 |       0 | 1-9               
+  branches.js                          |       0 |        0 |       0 |       0 | 1-20              
+  branches.typescript.ts               |       0 |        0 |       0 |       0 | 1-25              
+ c8/test/fixtures/source-maps/classes  |       0 |        0 |       0 |       0 |                   
+  class-1.js                           |       0 |        0 |       0 |       0 | 1-5               
+  class-2.js                           |       0 |        0 |       0 |       0 | 1-23              
+  classes.js                           |       0 |        0 |       0 |       0 | 1-27              
+  classes.typescript.ts                |       0 |        0 |       0 |       0 | 1-33              
+---------------------------------------|---------|----------|---------|---------|-------------------
 ,"
 `;
 

From dc87b08cf1a5043536a2feab1b46883cb538ef5b Mon Sep 17 00:00:00 2001
From: "bencoe@google.com" <bencoe@google.com>
Date: Mon, 16 May 2022 00:09:03 +0000
Subject: [PATCH 5/6] chore: update snapshots

---
 test/integration.js         | 2 +-
 test/integration.js.snap    | 6 +++---
 test/integration.js_10.snap | 4 ++++
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/test/integration.js b/test/integration.js
index 7ae8f513..385b3a26 100644
--- a/test/integration.js
+++ b/test/integration.js
@@ -639,7 +639,7 @@ describe('c8', () => {
         '--extension=.js',
         '--extension=.special',
         '--temp-directory=tmp/extension',
-        '--clean=false',
+        '--clean=true',
         nodePath,
         require.resolve('./fixtures/custom-ext.special')
       ])
diff --git a/test/integration.js.snap b/test/integration.js.snap
index 071a30c8..08062f5f 100644
--- a/test/integration.js.snap
+++ b/test/integration.js.snap
@@ -156,15 +156,15 @@ hey
 ---------------------------------------|---------|----------|---------|---------|-------------------
 File                                   | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
 ---------------------------------------|---------|----------|---------|---------|-------------------
-All files                              |    1.98 |       12 |    6.25 |    1.98 |                   
+All files                              |    1.93 |       12 |    6.25 |    1.93 |                   
  c8                                    |       0 |        0 |       0 |       0 |                   
   index.js                             |       0 |        0 |       0 |       0 | 1                 
  c8/bin                                |       0 |        0 |       0 |       0 |                   
   c8.js                                |       0 |        0 |       0 |       0 | 1-52              
  c8/coverage                           |       0 |        0 |       0 |       0 |                   
-  block-navigation.js                  |       0 |        0 |       0 |       0 | 1-79              
+  block-navigation.js                  |       0 |        0 |       0 |       0 | 1-87              
   prettify.js                          |       0 |        0 |       0 |       0 | 1-2               
-  sorter.js                            |       0 |        0 |       0 |       0 | 1-170             
+  sorter.js                            |       0 |        0 |       0 |       0 | 1-196             
  c8/lib                                |       0 |        0 |       0 |       0 |                   
   is-cjs-esm-bridge.js                 |       0 |        0 |       0 |       0 | 1-10              
   parse-args.js                        |       0 |        0 |       0 |       0 | 1-218             
diff --git a/test/integration.js_10.snap b/test/integration.js_10.snap
index 9ec617bf..fd6cd24d 100644
--- a/test/integration.js_10.snap
+++ b/test/integration.js_10.snap
@@ -156,7 +156,11 @@ hey
 ---------------------------------------|---------|----------|---------|---------|-------------------
 File                                   | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
 ---------------------------------------|---------|----------|---------|---------|-------------------
+<<<<<<< HEAD
 All files                              |    1.91 |       12 |    8.16 |    1.91 |                   
+=======
+All files                              |    1.93 |       12 |    8.16 |    1.93 |                   
+>>>>>>> 1d472bd (chore: update snapshots)
  c8                                    |       0 |        0 |       0 |       0 |                   
   index.js                             |       0 |        0 |       0 |       0 | 1                 
  c8/bin                                |       0 |        0 |       0 |       0 |                   

From 186825a64cd93dea98a8c0b45e8859f478be3574 Mon Sep 17 00:00:00 2001
From: "bencoe@google.com" <bencoe@google.com>
Date: Mon, 16 May 2022 00:17:23 +0000
Subject: [PATCH 6/6] chore: fix snapshots

---
 test/integration.js.snap    | 4 ++--
 test/integration.js_10.snap | 4 ----
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/test/integration.js.snap b/test/integration.js.snap
index 08062f5f..9a07de94 100644
--- a/test/integration.js.snap
+++ b/test/integration.js.snap
@@ -156,7 +156,7 @@ hey
 ---------------------------------------|---------|----------|---------|---------|-------------------
 File                                   | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
 ---------------------------------------|---------|----------|---------|---------|-------------------
-All files                              |    1.93 |       12 |    6.25 |    1.93 |                   
+All files                              |    1.91 |       12 |    6.25 |    1.91 |                   
  c8                                    |       0 |        0 |       0 |       0 |                   
   index.js                             |       0 |        0 |       0 |       0 | 1                 
  c8/bin                                |       0 |        0 |       0 |       0 |                   
@@ -168,7 +168,7 @@ All files                              |    1.93 |       12 |    6.25 |    1.93
  c8/lib                                |       0 |        0 |       0 |       0 |                   
   is-cjs-esm-bridge.js                 |       0 |        0 |       0 |       0 | 1-10              
   parse-args.js                        |       0 |        0 |       0 |       0 | 1-218             
-  report.js                            |       0 |        0 |       0 |       0 | 1-319             
+  report.js                            |       0 |        0 |       0 |       0 | 1-337             
   source-map-from-file.js              |       0 |        0 |       0 |       0 | 1-100             
  c8/lib/commands                       |       0 |        0 |       0 |       0 |                   
   check-coverage.js                    |       0 |        0 |       0 |       0 | 1-70              
diff --git a/test/integration.js_10.snap b/test/integration.js_10.snap
index fd6cd24d..9ec617bf 100644
--- a/test/integration.js_10.snap
+++ b/test/integration.js_10.snap
@@ -156,11 +156,7 @@ hey
 ---------------------------------------|---------|----------|---------|---------|-------------------
 File                                   | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
 ---------------------------------------|---------|----------|---------|---------|-------------------
-<<<<<<< HEAD
 All files                              |    1.91 |       12 |    8.16 |    1.91 |                   
-=======
-All files                              |    1.93 |       12 |    8.16 |    1.93 |                   
->>>>>>> 1d472bd (chore: update snapshots)
  c8                                    |       0 |        0 |       0 |       0 |                   
   index.js                             |       0 |        0 |       0 |       0 | 1                 
  c8/bin                                |       0 |        0 |       0 |       0 |