Open nottoseethesun opened 10 years ago
@christopherbalz Thanks for reporting. Let me take a look.
Let me know if you need any help.
Any status update on this?
@christopherbalz ,
Havent got a chance yet to look into this. Do you mind sending a PR ?
Attached to the first entry in this ticket is a reproduction of the issue: http://treelogic-swe.com/opensource-download/foo.tar.gz Let me know if that requires clarification and I will create it.
You must mean "pull request" by PR - yes I will do so if time allows.
Also, could we please get this labeled as a bug, since we provided an example of the bug ?
@christopherbalz
This project is no longer being actively worked upon. Please feel free to send PR if time permits.
Ok, thank you, will do.
Coverage report now works by adding "--lib" option in this case: ./node_modules/.bin/arrow test/MyTest.js --engine=mocha --coverage --lib=./src
In fact, I found "--lib=./src" specifies the exact source code set to analyse in the coverage report by running the test, though here the name 'lib' looks confusing for including target source set.
I have created a pull request to the documentation that clarify the "--lib" usage in arrow code coverage: https://github.com/yahoo/arrow/pull/276
This issue can be closed now.
Pure mocha works with istanbul in my project, but arrow does not.
The above js code coverage report could be successfully generated by attaching to a pure mocha command:
But unfortunately, when using arrow:
we would get nothing covered at all:
Using the "--coverage" switch for arrow, per its documentation too (in https://github.com/yahoo/arrow/tree/master/docs/arrow_cookbook), also reports "0 / 0" coverage at last (printed after test done, appended to arrow's report). Not much more clue found in arrow's doc.
What is the correct way to use istanbul with arrow (or output coverage data with arrow)?
Is there any handy usage example of arrow with code coverage report generated by istanbul? Or any known project on github that uses arrow for testing while generates its code coverage data with istanbul?
Here is some example code for reproducing the Arrow zero-coverage issue:
Look at the three repeated tests as written in the npm test scripts in package.json. Only the first test (pure mocha + istanbul way) outputs the right coverage report:
But the following two other ways with Arrow do not.
They report nothing covered at all:
Example code.