rahu28 / js-test-driver

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

Can't work with IE: error loading file && encoding #147

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
jsTestDriver 1.2.2

1. Start the server (on Linux) 
> java -jar $JSTESTDRIVER_HOME/JsTestDriver-1.2.2.jar --port 4224

2. Write a dump test (see below)
3. Capture IE7 on WinXP in either mode (also 'works' with IE6/W2k Server)
4. Optionally capture Chrome on Linux and FF3 on the same WinXP

Expected behaviour: all tests are passed in all browsers. (Also any errors are 
desired in the native UTF-8 russian %-)

Actual output (indicates the errors in the last lines of the tests in the case 
of IE):
==============
......
Total 6 tests (Passed: 6; Fails: 0; Errors: 0) (2,00 ms)
  Chrome 6.0.472.63 Linux: Run 3 tests (Passed: 3; Fails: 0; Errors 0) (1,00 ms)
  Microsoft Internet Explorer 7.0 Windows: Run 2 tests (Passed: 0; Fails: 0; Errors 2) (0,00 ms)
    error loading file: /test//home/tut/tmp/jsTestDriver/JSLang/test/Array.js:13: ÐÑедполагаеÑÑÑ Ð½Ð°Ð»Ð¸Ñие иденÑиÑикаÑоÑа, ÑÑÑоки или ÑиÑла
    error loading file: /test//home/tut/tmp/jsTestDriver/JSLang/test/eval.js:8: ÐÑедполагаеÑÑÑ Ð½Ð°Ð»Ð¸Ñие иденÑиÑикаÑоÑа, ÑÑÑоки или ÑиÑла
  Firefox 3.6.10 Windows: Run 3 tests (Passed: 3; Fails: 0; Errors 0) (2,00 ms)
Tests failed.
==============

Tests:

// Array.js
TestCase("Array",{
    "test array splice should modify array" : function () {
        var arr = [1,2,3,4,5];
        var res = arr.splice(2,3);
        assertEquals( [1,2], arr );
    },
    "test array splice should return removed items" : function () {
        var arr = [1,2,3,4,5];
        var res = arr.splice(2,3);
        assertEquals( [3,4,5], res );
    },
});

// eval.js
TestCase("eval", {
    "test evaluate an arithmetic expression": function() {
        var expr = "3+20/5";
        eval("var res = "+expr);
        assertEquals(7, res);
    },
});

Original issue reported on code.google.com by toutouk...@gmail.com on 8 Oct 2010 at 4:58

GoogleCodeExporter commented 8 years ago
You should learn JS better.
var obj = {
    a: 1,
    b: 2,
}

is not a valid object for IE

check this: http://closure-compiler.appspot.com/home

put your code of Array.js there and compile, the result is:
Number of errors: 1

JSC_TRAILING_COMMA: Parse error. Internet Explorer has a non-standard 
intepretation of trailing commas. Arrays will have the wrong length and objects 
will not parse at all. at line 12 character 1

Original comment by anton.yacenko on 9 Oct 2010 at 10:11