THRIFT-5564: Add nodejs tests to github actions (#3082)
These tests exist, but don't currently run on github actions. This adds a new job to run these.
This also fixes the regression in the tests caused by https://github.com/apache/thrift/pull/3014.
diff --git a/lib/nodejs/lib/thrift/thrift.js b/lib/nodejs/lib/thrift/thrift.js
index f728eac..3a693f6 100644
--- a/lib/nodejs/lib/thrift/thrift.js
+++ b/lib/nodejs/lib/thrift/thrift.js
@@ -86,7 +86,7 @@
};
util.inherits(TApplicationException, TException);
-TApplicationException.prototype.read = function(input) {
+TApplicationException.prototype[Symbol.for("read")] = TApplicationException.prototype.read = function(input) {
var ftype;
var ret = input.readStructBegin('TApplicationException');
@@ -121,7 +121,7 @@
input.readStructEnd();
};
-TApplicationException.prototype.write = function(output){
+TApplicationException.prototype[Symbol.for("write")] = TApplicationException.prototype.write = function(output){
output.writeStructBegin('TApplicationException');
if (this.message) {
diff --git a/lib/nodejs/test/deep-constructor.test.js b/lib/nodejs/test/deep-constructor.test.js
index 504dacf..a91ddb1 100644
--- a/lib/nodejs/test/deep-constructor.test.js
+++ b/lib/nodejs/test/deep-constructor.test.js
@@ -28,7 +28,7 @@
buff = msg;
});
const prot = new thrift.TBinaryProtocol(transport);
- data.write(prot);
+ data[Symbol.for("write")](prot);
prot.flush();
return buff;
}
@@ -37,7 +37,7 @@
const t = new thrift.TFramedTransport(serialized);
const p = new thrift.TBinaryProtocol(t);
const data = new type();
- data.read(p);
+ data[Symbol.for("read")](p);
return data;
}
@@ -48,7 +48,7 @@
});
const protocol = new thrift.TJSONProtocol(transport);
protocol.writeMessageBegin("", 0, 0);
- data.write(protocol);
+ data[Symbol.for("write")](protocol);
protocol.writeMessageEnd();
protocol.flush();
return buff;
@@ -59,7 +59,7 @@
const protocol = new thrift.TJSONProtocol(transport);
protocol.readMessageBegin();
const data = new type();
- data.read(protocol);
+ data[Symbol.for("read")](protocol);
protocol.readMessageEnd();
return data;
}