THRIFT-4675: Generate Int64 constants for js
diff --git a/lib/js/Gruntfile.js b/lib/js/Gruntfile.js
index b32a016..87b826f 100644
--- a/lib/js/Gruntfile.js
+++ b/lib/js/Gruntfile.js
@@ -68,6 +68,16 @@
       ThriftGenDeepConstructor: {
         command: '../../compiler/cpp/thrift -gen js -o test ../../test/JsDeepConstructorTest.thrift'
       },
+      ThriftBrowserifyNodeInt64: {
+        command: [
+          './node_modules/browserify/bin/cmd.js ./node_modules/node-int64/Int64.js -s Int64 -o test/build/js/lib/Int64.js',
+          './node_modules/browserify/bin/cmd.js ../nodejs/lib/thrift/int64_util.js -s Int64Util -o test/build/js/lib/Int64Util.js',
+          './node_modules/browserify/bin/cmd.js ./node_modules/json-int64/index.js -s JSONInt64 -o test/build/js/lib/JSONInt64.js'
+        ].join(' && ')
+      },
+      ThriftGenInt64: {
+        command: '../../compiler/cpp/thrift -gen js -o test ../../test/Int64Test.thrift'
+      },
       ThriftGenDoubleConstants: {
         command: '../../compiler/cpp/thrift -gen js -o test ../../test/DoubleConstantsTest.thrift'
       },
@@ -147,6 +157,18 @@
           },
         }
       },
+      ThriftJS_Int64: {
+        options: {
+          urls: [
+            'http://localhost:8089/test-int64.html'
+          ],
+          puppeteer: {
+            headless: true,
+            args: ['--no-sandbox'],
+            ignoreHTTPSErrors: true,
+          },
+        }
+      },
       ThriftWS: {
         options: {
           urls: [
@@ -218,7 +240,7 @@
       }
     },
     jshint: {
-      // The main thrift library file. not es6 yet :(
+      // The main Thrift library file. not es6 yet :(
       lib: {
         src: ['src/**/*.js'],
       },
@@ -261,7 +283,7 @@
   grunt.loadNpmTasks('grunt-jsdoc');
   grunt.loadNpmTasks('grunt-shell-spawn');
 
-  grunt.registerTask('wait', 'Wait just one second for server to start', function () {
+  grunt.registerTask('wait', 'Wait just one second for the server to start', function () {
     var done = this.async();
     setTimeout(function() {
       done(true);
@@ -269,25 +291,37 @@
   });
 
   grunt.registerTask('installAndGenerate', [
-    'shell:InstallThriftJS', 'shell:InstallThriftNodeJSDep', 'shell:ThriftGen',
-    'shell:ThriftGenDeepConstructor', 'shell:ThriftGenDoubleConstants',
+    'shell:InstallThriftJS',
+    'shell:InstallThriftNodeJSDep',
+    'shell:ThriftGen',
+    'shell:ThriftGenDeepConstructor',
+    'shell:ThriftGenDoubleConstants',
     'shell:InstallTestLibs',
+    'shell:ThriftBrowserifyNodeInt64',
+    'shell:ThriftGenInt64'
   ]);
 
   grunt.registerTask('test', [
     'installAndGenerate',
     'jshint',
-    'shell:ThriftTestServer', 'shell:ThriftTestServer_TLS',
-    'shell:ThriftTestServerES6', 'shell:ThriftTestServerES6_TLS',
+    'shell:ThriftTestServer',
+    'shell:ThriftTestServer_TLS',
+    'shell:ThriftTestServerES6',
+    'shell:ThriftTestServerES6_TLS',
     'wait',
     'qunit:ThriftDeepConstructor',
-    'qunit:ThriftJS', 'qunit:ThriftJS_TLS',
+    'qunit:ThriftJS',
+    'qunit:ThriftJS_TLS',
     'qunit:ThriftJS_DoubleRendering',
     'qunit:ThriftWS',
-    'qunit:ThriftJSJQ', 'qunit:ThriftJSJQ_TLS',
+    'qunit:ThriftJSJQ',
+    'qunit:ThriftJSJQ_TLS',
     'qunit:ThriftWSES6',
-    'shell:ThriftTestServer:kill', 'shell:ThriftTestServer_TLS:kill',
-    'shell:ThriftTestServerES6:kill', 'shell:ThriftTestServerES6_TLS:kill',
+    'qunit:ThriftJS_Int64',
+    'shell:ThriftTestServer:kill',
+    'shell:ThriftTestServer_TLS:kill',
+    'shell:ThriftTestServerES6:kill',
+    'shell:ThriftTestServerES6_TLS:kill',
   ]);
   grunt.registerTask('default', ['test', 'concat', 'uglify', 'jsdoc']);
 };