Skip to content
New issue

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

Add test coverage #67

Merged
merged 1 commit into from
Sep 5, 2024
Merged

Add test coverage #67

merged 1 commit into from
Sep 5, 2024

Conversation

ehmicky
Copy link
Collaborator

@ehmicky ehmicky commented Sep 5, 2024

Fixes #64.

Output on Windows (since some logic is only run on Windows):

-------------|---------|----------|---------|---------|-------------------
File         | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
-------------|---------|----------|---------|---------|-------------------
All files    |   99.74 |    98.73 |     100 |   99.74 |                   
 context.js  |     100 |      100 |     100 |     100 |                   
 index.js    |     100 |      100 |     100 |     100 |                   
 iterable.js |   98.38 |    96.15 |     100 |   98.38 | 61                
 options.js  |     100 |      100 |     100 |     100 |                   
 pipe.js     |     100 |      100 |     100 |     100 |                   
 result.js   |     100 |    97.22 |     100 |     100 | 33                
 spawn.js    |     100 |      100 |     100 |     100 |                   
 windows.js  |     100 |      100 |     100 |     100 |                   
-------------|---------|----------|---------|---------|-------------------

Uncovered line in iterable.js is in a catch block that does await iterator.throw(error) which always throws (which c8 cannot guess).
Uncovered line in result.js is after a for await (...) loop which is intentionally never ending (which c8 cannot guess).

We could add c8 disable comments, but they seem to disagree with xo, and add more bytes to the npm install size, so I left it as is.

@sindresorhus sindresorhus merged commit a633081 into main Sep 5, 2024
12 checks passed
@sindresorhus sindresorhus deleted the c8 branch September 5, 2024 21:04
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.

Test coverage
2 participants