mirror of
https://github.com/protobufjs/protobuf.js.git
synced 2025-12-08 20:58:55 +00:00
* do not allow to extend same field twice to prevent the error * Ignore gitpod config * unit test for issue #1783 * using existing test file
19 lines
701 B
JavaScript
19 lines
701 B
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var path = require("path");
|
|
var tape = require("tape");
|
|
var protobuf = require("../index");
|
|
// to extend Root
|
|
require("../ext/descriptor");
|
|
tape.test("extensions", function (test) {
|
|
// load document with extended field imported multiple times
|
|
var root = protobuf.loadSync(path.resolve(__dirname, "data/test.proto"));
|
|
root.resolveAll();
|
|
// convert to Descriptor Set
|
|
var decodedDescriptorSet = root.toDescriptor("proto3");
|
|
// load back from descriptor set
|
|
var root2 = protobuf.Root.fromDescriptor(decodedDescriptorSet);
|
|
test.pass("should parse and resolve without errors");
|
|
test.end();
|
|
});
|