rahu28 / js-test-driver

Automatically exported from code.google.com/p/js-test-driver
0 stars 0 forks source link

Don't strip /*:DOC */ blocks before sending the JS to the browser #78

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. In a test case, have a /*:DOC */ block.
2. Add a failing assert, such as assertTrue(false)
3. Run the tests in a javascript engine that has stack traces (Firefox, Chrome, 
...)

What is the expected output? What do you see instead?
I expect the line numbers in the stack trace of a failing test case when the 
tests run to match the 
line numbers in my test file. Instead, it appears that the /*:DOC */ blocks 
have been stripped 
from the test case before the file is transferred to the browser. This causes a 
line number 
mismatch in the stack trace. This mismatch makes it hard to debug the tests, 
i.e. find the failing 
test case. This is especially true for test cases with multiple assertions.

What version of the product are you using? On what operating system?
The 1.2 release: http://js-test-driver.googlecode.com/files/JsTestDriver-1.2.jar

Please provide any additional information below.
I haven't actually read any code, so I'm just assuming that this - the /*:DOC 
*/ blocks are 
removed before the test case is transferred to the browser - is what's actually 
happening.

Original issue reported on code.google.com by augustlilleaas on 10 Dec 2009 at 8:20

GoogleCodeExporter commented 8 years ago
Update: this only affects multi-line comment blocks.

Does not affect line numbers in stack traces: /*:DOC += <div></div>*/

Affects line numbers in stack traces /*:DOC += <div>
  <div class="foo"></div>
  more stuff here
</div>*/

Original comment by augustlilleaas on 10 Dec 2009 at 11:11

GoogleCodeExporter commented 8 years ago

Original comment by corbinrs...@gmail.com on 10 Jan 2010 at 9:25

GoogleCodeExporter commented 8 years ago
Happens on 1.2.2, too.

Original comment by cwei...@cweiske.de on 5 Nov 2010 at 2:42

GoogleCodeExporter commented 8 years ago
Issue 11 has been merged into this issue.

Original comment by corbinrs...@gmail.com on 13 Dec 2010 at 3:42

GoogleCodeExporter commented 8 years ago
I am seeing the same problem, and to be clear it seems to happen for any 
multi-line comment (not just :DOC as the issue is titled).

Original comment by coolr...@gmail.com on 5 Jan 2011 at 10:24

GoogleCodeExporter commented 8 years ago
All multiline comments? In js or html?

Original comment by corbinrs...@gmail.com on 5 Jan 2011 at 10:26

GoogleCodeExporter commented 8 years ago
I take it back, now lines are lining up again. I swear I didn't change anything 
:). It was in JS, I will continue to watch for it to happen again to see if I 
can better reproduce it.
I thought it seemed to be multi-line related because of the line offset I was 
seeing, but I also just noticed some issues with JS files not being refreshed 
correctly which could the problem (so wrong line numbers because old file is 
loaded). Not sure if that is happening in IDEA, Server, Firefox, or Firebug 
(stopping server and closing/opening page fixes it). 
So, I will watch, reproduce and report when it happens again.

Original comment by coolr...@gmail.com on 6 Jan 2011 at 12:29

GoogleCodeExporter commented 8 years ago
Fixed as of revision 820

Original comment by corbinrs...@gmail.com on 9 Jan 2011 at 9:00