nikseras / js-test-driver

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

setTimeout() not run after coverage plugin instrumented #385

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. in production code, have function X call setTimeout("hide an element", 3000)
2. in test code, invoke function X
3. run the test code with coverage plugin
4. wait for 4 seconds, the element still on the page

What is the expected output? What do you see instead?
the element should disappear(display:none), but the element still on the page

What version of the product are you using? On what operating system?
1.3.4.b. server: Linux + JDK6, client: windows + JDK6, capture browser: chrome

Please provide any additional information below.
if you run the test code without the coverage plugin, everything would be fine.

Original issue reported on code.google.com by duk....@gmail.com on 22 Jun 2012 at 9:34

GoogleCodeExporter commented 8 years ago
Does it work without coverage?

Original comment by corbinrs...@gmail.com on 22 Jun 2012 at 9:35

GoogleCodeExporter commented 8 years ago
Yes, the setTimeout() would work properly without the coverage.

and I just realized, if you just run the single test, it also works properly, 
even with the coverage.

need to isolate the test?

Original comment by duk....@gmail.com on 22 Jun 2012 at 9:50

GoogleCodeExporter commented 8 years ago
Use this for testing setTimeout: 
http://code.google.com/p/js-test-driver/wiki/AsyncTestCase

JsTD resets the DOM after each test case.

Original comment by corbinrs...@gmail.com on 22 Jun 2012 at 9:52