wildfire chat server source initial submit

This commit is contained in:
heavyrain2012
2019-03-16 17:04:23 +08:00
parent e59217bd10
commit cab3ca0916
1466 changed files with 528862 additions and 15919 deletions
+21
View File
@@ -0,0 +1,21 @@
var tape = require("tape");
var protobuf = require("..");
var def = {
keyType: "bytes",
type: "string",
id: 1
};
tape.test("reflected map fields", function(test) {
var field = protobuf.MapField.fromJSON("a", def);
test.same(field.toJSON(), def, "should construct from and convert back to JSON");
test.throws(function() {
field.resolve();
}, Error, "should throw for invalid key types");
test.end();
});