LiTiang / js-test-driver

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

Unnecessary reloading of unchanged files #332

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Unpack the sample project I attached a simple project containing the files I 
used (it's basically the Getting Started tutorial + console.log).
2. Start the server with "java -jar JsTestDriver-1.3.4-a.jar --port 9876" and 
capture a browser that support's console.log (eg. Google Chrome)
3. Run your tests java -jar JsTestDriver-1.3.4-a.jar --tests all . Notice that 
the browser console should show:
====
A start
A ends
ATest start
ATest end
====
Meaning the first load of the files

4. Run your tests again java -jar JsTestDriver-1.3.4-a.jar --tests all and 
notice that the console don't show more messages besides the one you saw on 
step 3., because you didn't changed any file and JsTestDriver didn't needed to 
reload them.

5. Now change any file. For instance let's say src-test/a.js . Change the log 
"ATest start" -> "ATest start2".

6. Run your test and notice two new lines at the console as expected, because 
JsTestDriver reloaded the changed file.
=====
ATest start2
ATest end
=====

7. Now, just run your test one more time and notice that new messages keep 
being appended to the console indicating that a.js keep's being reloaded (I 
double checked using the Network Tab of Chrome Dev Tools). 
If you keep running the test again it will just keep reloading that file that 
didn't actually changed after the last reload.

JsTestDriver should only reload that file once if it has not changed.

What is the expected output? What do you see instead?

I explained in the 7. step of the previous question.

What version of the product are you using? On what operating system?

I'm running Mac OS X Lion with captured browser being Google Chrome and 
JsTestDriver-1.3.4-a from this link: 
http://code.google.com/p/js-test-driver/downloads/detail?name=JsTestDriver-1.3.4
-a.jar&can=2&q=

Original issue reported on code.google.com by walterca...@gmail.com on 7 Feb 2012 at 4:53

Attachments: