aboutsummaryrefslogtreecommitdiff
path: root/js/commonjs
diff options
context:
space:
mode:
authorPeter Marton <pmarton@netflix.com>2018-03-26 16:07:45 -0700
committerPeter Marton <pmarton@netflix.com>2018-05-08 09:23:56 -0700
commit13f94b4092cff9bc36a62adb4bf2e362b4f85979 (patch)
treee78104e42e6d56aa0233a829371bf639bfd3e469 /js/commonjs
parent3c4e36847330df7c6b3e136b5abf590466dac164 (diff)
downloadprotobuf-13f94b4092cff9bc36a62adb4bf2e362b4f85979.tar.gz
protobuf-13f94b4092cff9bc36a62adb4bf2e362b4f85979.tar.bz2
protobuf-13f94b4092cff9bc36a62adb4bf2e362b4f85979.zip
Fix strict JS generator with import in a protofile
Diffstat (limited to 'js/commonjs')
-rw-r--r--js/commonjs/strict_test.js19
1 files changed, 16 insertions, 3 deletions
diff --git a/js/commonjs/strict_test.js b/js/commonjs/strict_test.js
index 12df8f85..46458c10 100644
--- a/js/commonjs/strict_test.js
+++ b/js/commonjs/strict_test.js
@@ -40,15 +40,28 @@ var global = Function('return this')();
googleProtobuf.object.extend(global, asserts);
var test9_pb = require('./test9_pb');
+var test10_pb = require('./test10_pb');
describe('Strict test suite', function() {
it('testImportedMessage', function() {
- var simple1 = new test9_pb.Simple9()
- var simple2 = new test9_pb.Simple9()
+ var simple1 = new test9_pb.jspb.exttest.strict.nine.Simple9()
+ var simple2 = new test9_pb.jspb.exttest.strict.nine.Simple9()
assertObjectEquals(simple1.toObject(), simple2.toObject());
});
it('testGlobalScopePollution', function() {
- assertObjectEquals(global.proto.jspb.test.Simple9, undefined);
+ assertObjectEquals(global.jspb.exttest, undefined);
+ });
+
+ describe('with imports', function() {
+ it('testImportedMessage', function() {
+ var simple1 = new test10_pb.jspb.exttest.strict.ten.Simple10()
+ var simple2 = new test10_pb.jspb.exttest.strict.ten.Simple10()
+ assertObjectEquals(simple1.toObject(), simple2.toObject());
+ });
+
+ it('testGlobalScopePollution', function() {
+ assertObjectEquals(global.jspb.exttest, undefined);
+ });
});
});