We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When:
A
B
super()
Then:
The line containing the closing brace of the constructor method is shown as uncovered by c8.
(Testing with latest c8, tape and tap-nyc in a "type": "module" node project.)
c8
tape
tap-nyc
"type": "module"
import B from './B.js' export default class A extends B { constructor () { super() return } }
export default class B {}
test.js
import test from 'tape' import A from './A.js' test('bug', t => { const a = new A() t.true(a instanceof A, 'the returned object is as expected') t.end() })
npx c8 node test.js | npx tap-nyc
Coverage should be 100%
Class A’s coverage is 66.67%, with line 7 flagged as uncovered.
Ignore the return statement and the line after it. e.g., modify the constructor in class A from the above example to match the following:
import B from './B.js' export default class A extends B { constructor () { super() /* c8 ignore next 2 */ return } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Summary
When:
A
extendsB
andA
’s constructor callssuper()
andA
constructor contains a return statementThen:
The line containing the closing brace of the constructor method is shown as uncovered by c8.
To reproduce
(Testing with latest
c8
,tape
andtap-nyc
in a"type": "module"
node project.)A
in A.js:B
in B.js:test.js
:What should happen
Coverage should be 100%
What actually happens
Class
A
’s coverage is 66.67%, with line 7 flagged as uncovered.Workaround
Ignore the return statement and the line after it. e.g., modify the constructor in class
A
from the above example to match the following:The text was updated successfully, but these errors were encountered: