Skip to content

Commit

Permalink
Fixed failing test case on node < 6
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO committed Dec 10, 2016
1 parent 66be598 commit c3c70fe
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tests/base64.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ tape.test("base64", function(test) {
var len2 = protobuf.util.decode64(enc, buf, 0);
test.equal(len2, len, "should decode '" + enc + "' to " + len + " bytes");

if (protobuf.util.isNode) {
var comp = global.Buffer.from(buf).toString("utf8");
test.equal(comp, str, "should decode '" + enc + "' to '" + str + "'");
}
if (protobuf.util.isNode && protobuf.util.Buffer)
test.equal(buf.toString("utf8"), str, "should decode '" + enc + "' to '" + str + "'");

var enc2 = protobuf.util.encode64(buf, 0, buf.length);
test.equal(enc2, enc, "should encode '" + str + "' to '" + enc + "'");
Expand Down

0 comments on commit c3c70fe

Please sign in to comment.