-
Notifications
You must be signed in to change notification settings - Fork 11
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
Support reporting coverage for tests #36
Conversation
CoverageObject.prototype = { | ||
constructor: CoverageObject, | ||
|
||
addStatement: function (start, end, counter) { |
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.
вот эти три функции(addStatement
, addFunction
, addBranch
) несколько похожи друг на друга. Нет желания подрефакторить и убрать дублирование?
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.
Мне кажется, что эта похожесть — совпадение
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.
Похожесть только видимая, на самом деле:
- source достается из разных локаций (
start
для стейтментов и функций,locations[0]
для бранчей) - индексы берутся из разных переменных (
b
,f
,s
) - метаданные записываются в разные объекты (
branchMap
,functionMap
,statementMap
) - структура метаданных везде разная (для стейтмена – просто
start
иend
, для функции{name, loc: {start, end}}
, для ветвлений{line, type, locations: [{start, end}]
) - счетчики записываются в разные объекты
b
,f
,s
.
@SevInf ping! |
42c6bdd
to
cb1af0b
Compare
@SevInf для опций логично ожидать значений по умолчанию как в
|
cb1af0b
to
3d11ce7
Compare
@andrewblond, поправил, нужно финальное ревью. |
640985c
to
e4b9700
Compare
@andrewblond исправил вчерашний баг |
If `coverage` options is set, template files will be instrumented before execution (can be enabled per-technology). If templates are built with source map, there is an option to show coverage for original files. There is also an option to filter out some sources from report. By default, all content of `node_modules` and `libs` will be omitted.
e4b9700
to
97508b4
Compare
@SevInf, всё супер! =) |
Support reporting coverage for tests
Вошло в версию |
If
coverage
options is set, template files will be instrumentedbefore execution (can be enabled per-technology). If templates are
built with source map, there is an option to show coverage for
original files.
There is also an option to filter out some sources from report. By
default, all content of
node_modules
andlibs
will be omitted.@andrewblond @arikon @j0tunn