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

[Storage] Exclude dotenv package from nyc code coverage #2820

Closed
HarshaNalluru opened this issue May 11, 2019 · 3 comments
Closed

[Storage] Exclude dotenv package from nyc code coverage #2820

HarshaNalluru opened this issue May 11, 2019 · 3 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. Storage Storage Service (Queues, Blobs, Files)

Comments

@HarshaNalluru
Copy link
Member

#2297 (comment)

@kurtzeborn kurtzeborn added Client This issue points to a problem in the data-plane of the library. Storage Storage Service (Queues, Blobs, Files) labels May 15, 2019
@HarshaNalluru
Copy link
Member Author

imgpsh_mobile_save
fs-extra has the same issue.

@jeremymeng
Copy link
Contributor

I believe it is because we are running code coverage on the bundled single file. I tried running nyc test on unbundled files (with the help of esm package). The report looks as expected:

npx nyc mocha -r esm --require source-map-support/register --reporter mocha-multi --reporter-options spec=-,mocha-junit-reporter=- --full-trace -t 120000 --retries 2 dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js
File   Statements   Branches   Functions   Lines  
test   97.94% 1614/1648 87.58% 134/153 100% 147/147 97.41% 1280/1314
test/node   98.58% 835/847 82.61% 19/23 100% 101/101 98.34% 710/722

jeremymeng added a commit to jeremymeng/azure-sdk-for-js that referenced this issue Dec 18, 2019
The code coverage report include data for dependencies (`dotenv` for
example). This is because we run the test on the one single bundled
file, while nyc exclusion works by not instrumenting imported or
required modules in the exclusion list.

This change run nyc on individual spec.js files instead. A dev
dependency `esm` is introduced so that nyc can load our test modules.

NodeJS part of Azure#2820.
jeremymeng added a commit to jeremymeng/azure-sdk-for-js that referenced this issue Dec 18, 2019
The code coverage report include data for dependencies (`dotenv` for
example). This is because we run the test on the one single bundled
file, while nyc exclusion works by not instrumenting imported or
required modules in the exclusion list.

This change run nyc on individual spec.js files instead. A dev
dependency `esm` is introduced so that nyc can load our test modules.

NodeJS part of Azure#2820.
jeremymeng added a commit that referenced this issue Dec 18, 2019
The code coverage report include data for dependencies (`dotenv` for
example). This is because we run the test on the one single bundled
file, while nyc exclusion works by not instrumenting imported or
required modules in the exclusion list.

This change run nyc on individual spec.js files instead. A dev
dependency `esm` is introduced so that nyc can load our test modules.

NodeJS part of #2820.
@jeremymeng
Copy link
Contributor

browser part: #6666

@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

No branches or pull requests

3 participants