Skip to content

feat: allow rows with 100% statement, branch, and function coverage to be skipped in text report - #859

Merged
bcoe merged 3 commits into
masterfrom
skip-full
Jun 8, 2018
Merged

feat: allow rows with 100% statement, branch, and function coverage to be skipped in text report#859
bcoe merged 3 commits into
masterfrom
skip-full

Conversation

@bcoe

@bcoe bcoe commented Jun 6, 2018

Copy link
Copy Markdown
Member

@chrismohr ☝️ I note that for skipEmpty we actually support both text and HTML reports; might be a good next contribution for you?

CC: @coreyfarrell for review.

@bcoe
bcoe requested a review from coreyfarrell June 6, 2018 21:51
@coreyfarrell

Copy link
Copy Markdown
Member

@bcoe would be nice to add a test verifying that --skip-full doesn't skip sources that aren't fully covered. Otherwise this looks good to me.

    it('does displays files without 100% statement, branch, and function coverage', (done) => {
      const args = [
        bin,
        '--skip-full',
        process.execPath, './instrumented/s1.min.js'
      ]

      const proc = spawn(process.execPath, args, {
        cwd: fixturesSourceMaps,
        env: env
      })

      var stdout = ''
      proc.stdout.on('data', function (chunk) {
        stdout += chunk
      })

      proc.on('close', function (code) {
        code.should.equal(0)
        stdoutShouldEqual(stdout, `
        ----------|----------|----------|----------|----------|-------------------|
        File      |  % Stmts | % Branch |  % Funcs |  % Lines | Uncovered Line #s |
        ----------|----------|----------|----------|----------|-------------------|
        All files |       80 |      100 |       50 |       80 |                   |
         s1.js    |       80 |      100 |       50 |       80 |                 7 |
        ----------|----------|----------|----------|----------|-------------------|`)
        done()
      })
    })

@bcoe
bcoe merged commit 893345a into master Jun 8, 2018
@bcoe
bcoe deleted the skip-full branch June 8, 2018 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants