-
Notifications
You must be signed in to change notification settings - Fork 30.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
test_runner: remove redundant check from coverage #48070
Conversation
Review requested:
|
I am not sure I understand why this is redundant |
lib/internal/test_runner/coverage.js
Outdated
if (StringPrototypeIncludes(url, '/node_modules/') || | ||
// On Windows some generated coverages are invalid. | ||
!StringPrototypeStartsWith(url, 'file:')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we start with the file:
check so core modules can still skip the /node_modules/
check? I suggest we also remove the comment which looks a bit out of place/context.
if (StringPrototypeIncludes(url, '/node_modules/') || | |
// On Windows some generated coverages are invalid. | |
!StringPrototypeStartsWith(url, 'file:')) { | |
if (!StringPrototypeStartsWith(url, 'file:') || StringPrototypeIncludes(url, '/node_modules/')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll remove the comment. I think having the node_modules check first will be more beneficial in real world apps where the node_modules directory makes up the bulk of the app.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fair, maybe add a comment explaining the order was chosen purposefully and why
All of the valid coverages should start with |
The code coverage reporting logic already filters out URLs that don't start with 'file:', so there is no need to also filter out URLs that start with 'node:'.
Landed in b47fce0 |
The code coverage reporting logic already filters out URLs that don't start with 'file:', so there is no need to also filter out URLs that start with 'node:'. PR-URL: #48070 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
The code coverage reporting logic already filters out URLs that don't start with 'file:', so there is no need to also filter out URLs that start with 'node:'. PR-URL: #48070 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
The code coverage reporting logic already filters out URLs that don't start with 'file:', so there is no need to also filter out URLs that start with 'node:'. PR-URL: nodejs#48070 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
The code coverage reporting logic already filters out URLs that don't start with 'file:', so there is no need to also filter out URLs that start with 'node:'. PR-URL: nodejs#48070 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
The code coverage reporting logic already filters out URLs that don't start with 'file:', so there is no need to also filter out URLs that start with 'node:'. PR-URL: nodejs#48070 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
The code coverage reporting logic already filters out URLs that don't start with 'file:', so there is no need to also filter out URLs that start with 'node:'.