LiTiang / js-test-driver

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

Trunk (as of 1/12/11) reports errors loading script files when 1.2.2 did not #190

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Define a config file that contains references to script files to load
  where the path to the file is something like ../foo/bar/xyz.js (i.e. it
  is not under the current directory
2.Run a test like this against the JsTestDriver-1.2.2.jar, and notice that
  the file or files seem to be read and processed correctly.
3.Using exactly the same config file, run a test against a trunk build
  (I downloaded the source trunk on 1/11/11 and it reported no build 
  errors when generating the JAR.)

What is the expected output? What do you see instead?
I expect the output should be similar/identical to that in 1.2.2.  
However, now the script files all report 
"error loading file: /test/../foo/bar/xyz.js: [object Event]".  
The tests, however, do appear to attempt to run, though of course get errors 
now that the script files don't load right.

What version of the product are you using? On what operating system?
trunk as of 1/11/11, Built and running on a 64-bit Ubuntu 11.04.

Please provide any additional information below.
I'm also very curious why when the files are reported as having problems,
there is a '/test/' prepended to the file name in the error.  I do not
have a directory named 'test'--my config file is in the same directory
as a copy of the JsTestDriver.jar, and the source JS files are in sibling
directories to this directory.
All of this was needed because I need to be able to use AsyncTestCase, as all 
the code we want to test is concerned with doing HTML5 Websocket calls to a 
backend server.

Original issue reported on code.google.com by runt...@gmail.com on 12 Jan 2011 at 11:16

GoogleCodeExporter commented 9 years ago
This is fixed in 1.3.0, which will translate ../ to _/

You can also set the "basepath" in the config file to avoid using ../ (the 
relative path handling below the base dir is full of nasty edge cases.)

/test/ is prepended as that is the path to the file on the server. 

Reopen if you have difficulties.

Original comment by corbinrs...@gmail.com on 14 Feb 2011 at 4:28