8000 Fix up commonjs import tests · DariushStony/protobuf-javascript@cf834e5 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cf834e5

Browse files
committed
Fix up commonjs import tests
These were revealed to be broken by the clean test build environment. Need to remove more closure asserts.
1 parent b449db4 commit cf834e5

File tree

2 files changed

+17
-24
lines changed

2 files changed

+17
-24
lines changed

commonjs/import_test.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,18 @@
3232

3333

3434

35-
var googleProtobuf = require('google-protobuf');
36-
var asserts = require('closure_asserts_commonjs');
37-
var global = Function('return this')();
35+
const googleProtobuf = require('google-protobuf');
36+
const global = Function('return this')();
3837

39-
// Bring asserts into the global namespace.
40-
googleProtobuf.object.extend(global, asserts);
4138
googleProtobuf.exportSymbol('jspb.Message', googleProtobuf.Message, global);
4239

4340
var test7_pb = require('./test7/test7_pb');
4441
googleProtobuf.exportSymbol('proto.jspb.test.framing.FramingMessage', test7_pb.FramingMessage, global);
4542

4643
describe('Import test suite', function() {
4744
it('testImportedMessage', function() {
48-
var framing1 = new proto.jspb.test.framing.FramingMessage([]);
49-
var framing2 = new proto.jspb.test.framing.FramingMessage([]);
50-
assertObjectEquals(framing1.toObject(), framing2.toObject());
45+
const framing1 = new proto.jspb.test.framing.FramingMessage([]);
46+
const framing2 = new proto.jspb.test.framing.FramingMessage([]);
47+
expect(framing1.toObject()).toEqual(framing2.toObject());
5148
});
5249
});

commonjs/strict_test.js

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,36 +32,32 @@
3232

3333

3434

35-
var googleProtobuf = require('google-protobuf');
36-
var asserts = require('closure_asserts_commonjs');
37-
var global = Function('return this')();
35+
const googleProtobuf = require('google-protobuf');
36+
const global = Function('return this')();
3837

39-
// Bring asserts into the global namespace.
40-
googleProtobuf.object.extend(global, asserts);
41-
42-
var test9_pb = require('./protos/test9_pb');
43-
var test10_pb = require('./protos/test10_pb');
38+
const test9_pb = require('./protos/test9_pb');
39+
const test10_pb = require('./protos/test10_pb');
4440

4541
describe('Strict test suite', function() {
4642
it('testImportedMessage', function() {
47-
var simple1 = new test9_pb.jspb.exttest.strict.nine.Simple9()
48-
var simple2 = new test9_pb.jspb.exttest.strict.nine.Simple9()
49-
assertObjectEquals(simple1.toObject(), simple2.toObject());
43+
const simple1 = new test9_pb.jspb.exttest.strict.nine.Simple9()
44+
const simple2 = new test9_pb.jspb.exttest.strict.nine.Simple9()
45+
expect(simple1.toObject()).toEqual(simple2.toObject());
5046
});
5147

5248
it('testGlobalScopePollution', function() {
53-
assertO 8000 bjectEquals(global.jspb.exttest, undefined);
49+
expect(global.jspb.exttest).toBeUndefined();
5450
});
5551

5652
describe('with imports', function() {
5753
it('testImportedMessage', function() {
58-
var simple1 = new test10_pb.jspb.exttest.strict.ten.Simple10()
59-
var simple2 = new test10_pb.jspb.exttest.strict.ten.Simple10()
60-
assertObjectEquals(simple1.toObject(), simple2.toObject());
54+
const simple1 = new test10_pb.jspb.exttest.strict.ten.Simple10()
55+
const simple2 = new test10_pb.jspb.exttest.strict.ten.Simple10()
56+
expect(simple1.toObject()).toEqual(simple2.toObject());
6157
});
6258

6359
it('testGlobalScopePollution', function() {
64-
assertObjectEquals(global.jspb.exttest, undefined);
60+
expect(global.jspb.exttest).toBeUndefined();
6561
});
6662
});
6763
});

0 commit comments

Comments
 (0)
0