THRIFT-2190 Add the JavaScript thrift.js lib to the Bower registry
Client: nodejs
Patch: Randy Abernethy
plus path changes
diff --git a/lib/js/test/build.xml b/lib/js/test/build.xml
index 53bec58..e302ea0 100755
--- a/lib/js/test/build.xml
+++ b/lib/js/test/build.xml
@@ -100,7 +100,7 @@
<get src="http://code.jquery.com/qunit/qunit-1.5.0.js" dest="${build}/js/lib/qunit.js" usetimestamp="true"/>
<get src="http://code.jquery.com/qunit/qunit-1.5.0.css" dest="${build}/js/lib/qunit.css" usetimestamp="true"/>
<!-- js-test-driver has issues with relative path...so we need a copy -->
- <copy file="../thrift.js" todir="${build}/js/"/>
+ <copy file="../src/thrift.js" todir="${build}/js/"/>
</target>
<target name="compile" description="compile the test suite" depends="init, generate, resolve">
@@ -216,7 +216,7 @@
<jsl:jslint options="evil,forin,browser,bitwise,regexp,newcap,immed" encoding="UTF-8">
<formatter type="plain" />
<fileset dir="${genjs}" includes="**/*.js" />
- <fileset dir=".." includes="thrift.js" />
+ <fileset dir="../src" includes="thrift.js" />
<!-- issues with unsafe character -->
<!-- fileset dir="." includes="*test*.js" /> -->
@@ -234,7 +234,7 @@
<exec executable="gjslint" failifexecutionfails="no">
<arg line="--nojsdoc"/>
<arg line="${genjs}/*.js"/>
- <arg line="../thrift.js"/>
+ <arg line="../src/thrift.js"/>
<!-- issues with unsafe character, etc. -->
<!-- <arg line="*test*.js"/> -->
diff --git a/lib/js/test/phantomjs-qunit.js b/lib/js/test/phantomjs-qunit.js
index d52b522..027be40 100755
--- a/lib/js/test/phantomjs-qunit.js
+++ b/lib/js/test/phantomjs-qunit.js
@@ -1,3 +1,5 @@
+/*jshint evil:true*/
+
/* This file is only used by the test suite.
*
* Origin: https://github.com/ariya/phantomjs/blob/master/examples/run-qunit.js
@@ -35,12 +37,16 @@
} else {
// Condition fulfilled (timeout and/or condition is 'true')
console.log("'waitFor()' finished in " + (new Date().getTime() - start) + "ms.");
- typeof(onReady) === "string" ? eval(onReady) : onReady(); //< Do what it's supposed to do once the condition is fulfilled
+ if (typeof(onReady) === "string") {
+ eval(onReady);
+ } else {
+ onReady(); //< Do what it's supposed to do once the condition is fulfilled
+ }
clearInterval(interval); //< Stop this interval
}
}
}, 100); //< repeat check every 250ms
-};
+}
if (phantom.args.length === 0 || phantom.args.length > 2) {
diff --git a/lib/js/test/test.html b/lib/js/test/test.html
index 1c8fc9a..93894c7 100755
--- a/lib/js/test/test.html
+++ b/lib/js/test/test.html
@@ -22,7 +22,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Thrift Javascript Bindings: Unit Test</title>
- <script src="/thrift.js" type="text/javascript" charset="utf-8"></script>
+ <script src="/src/thrift.js" type="text/javascript" charset="utf-8"></script>
<script src="gen-js/ThriftTest_types.js" type="text/javascript" charset="utf-8"></script>
<script src="gen-js/ThriftTest.js" type="text/javascript" charset="utf-8"></script>
diff --git a/lib/js/test/test.js b/lib/js/test/test.js
index 99fcc41..b0904a9 100755
--- a/lib/js/test/test.js
+++ b/lib/js/test/test.js
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-
+ /* jshint -W100 */
/*
* JavaScript test suite
@@ -401,6 +401,8 @@
.error(function(xhr, status, e){
equal(e.errorCode, 1001);
equal(e.message, "Xception");
- QUnit.start();
+ //QUnit.start();
+ //Note start is not required here because:
+ //$(document).ajaxError( function() { QUnit.start(); } );
});
});