Skip to content

Commit 3c995a1

Browse files
JustinBeckwithjkwlui
authored andcommitted
test: use strictEqual in tests (#186)
1 parent 3a51de3 commit 3c995a1

5 files changed

Lines changed: 39 additions & 39 deletions

File tree

handwritten/pubsub/system-test/pubsub.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ describe('pubsub', function() {
129129
});
130130

131131
// get all topics in list of known names
132-
assert.equal(results.length, TOPIC_NAMES.length);
132+
assert.strictEqual(results.length, TOPIC_NAMES.length);
133133
done();
134134
});
135135
});
@@ -149,7 +149,7 @@ describe('pubsub', function() {
149149
return TOPIC_FULL_NAMES.indexOf(name) !== -1;
150150
});
151151

152-
assert.equal(results.length, TOPIC_NAMES.length);
152+
assert.strictEqual(results.length, TOPIC_NAMES.length);
153153
done();
154154
});
155155
});
@@ -303,7 +303,7 @@ describe('pubsub', function() {
303303
it('should list all subscriptions registered to the topic', function(done) {
304304
topic.getSubscriptions(function(err, subs) {
305305
assert.ifError(err);
306-
assert.equal(subs.length, SUBSCRIPTIONS.length);
306+
assert.strictEqual(subs.length, SUBSCRIPTIONS.length);
307307
assert(subs[0] instanceof Subscription);
308308
done();
309309
});
@@ -319,7 +319,7 @@ describe('pubsub', function() {
319319
subscriptionsEmitted.push(subscription);
320320
})
321321
.on('end', function() {
322-
assert.equal(subscriptionsEmitted.length, SUBSCRIPTIONS.length);
322+
assert.strictEqual(subscriptionsEmitted.length, SUBSCRIPTIONS.length);
323323
done();
324324
});
325325
});

handwritten/pubsub/test/gapic-v1.js

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ describe('PublisherClient', () => {
7777

7878
client.createTopic(request, (err, response) => {
7979
assert(err instanceof Error);
80-
assert.equal(err.code, FAKE_STATUS_CODE);
80+
assert.strictEqual(err.code, FAKE_STATUS_CODE);
8181
assert(typeof response === 'undefined');
8282
done();
8383
});
@@ -141,7 +141,7 @@ describe('PublisherClient', () => {
141141

142142
client.updateTopic(request, (err, response) => {
143143
assert(err instanceof Error);
144-
assert.equal(err.code, FAKE_STATUS_CODE);
144+
assert.strictEqual(err.code, FAKE_STATUS_CODE);
145145
assert(typeof response === 'undefined');
146146
done();
147147
});
@@ -214,7 +214,7 @@ describe('PublisherClient', () => {
214214

215215
client.publish(request, (err, response) => {
216216
assert(err instanceof Error);
217-
assert.equal(err.code, FAKE_STATUS_CODE);
217+
assert.strictEqual(err.code, FAKE_STATUS_CODE);
218218
assert(typeof response === 'undefined');
219219
done();
220220
});
@@ -274,7 +274,7 @@ describe('PublisherClient', () => {
274274

275275
client.getTopic(request, (err, response) => {
276276
assert(err instanceof Error);
277-
assert.equal(err.code, FAKE_STATUS_CODE);
277+
assert.strictEqual(err.code, FAKE_STATUS_CODE);
278278
assert(typeof response === 'undefined');
279279
done();
280280
});
@@ -337,7 +337,7 @@ describe('PublisherClient', () => {
337337

338338
client.listTopics(request, (err, response) => {
339339
assert(err instanceof Error);
340-
assert.equal(err.code, FAKE_STATUS_CODE);
340+
assert.strictEqual(err.code, FAKE_STATUS_CODE);
341341
assert(typeof response === 'undefined');
342342
done();
343343
});
@@ -404,7 +404,7 @@ describe('PublisherClient', () => {
404404

405405
client.listTopicSubscriptions(request, (err, response) => {
406406
assert(err instanceof Error);
407-
assert.equal(err.code, FAKE_STATUS_CODE);
407+
assert.strictEqual(err.code, FAKE_STATUS_CODE);
408408
assert(typeof response === 'undefined');
409409
done();
410410
});
@@ -454,7 +454,7 @@ describe('PublisherClient', () => {
454454

455455
client.deleteTopic(request, err => {
456456
assert(err instanceof Error);
457-
assert.equal(err.code, FAKE_STATUS_CODE);
457+
assert.strictEqual(err.code, FAKE_STATUS_CODE);
458458
done();
459459
});
460460
});
@@ -519,7 +519,7 @@ describe('PublisherClient', () => {
519519

520520
client.setIamPolicy(request, (err, response) => {
521521
assert(err instanceof Error);
522-
assert.equal(err.code, FAKE_STATUS_CODE);
522+
assert.strictEqual(err.code, FAKE_STATUS_CODE);
523523
assert(typeof response === 'undefined');
524524
done();
525525
});
@@ -581,7 +581,7 @@ describe('PublisherClient', () => {
581581

582582
client.getIamPolicy(request, (err, response) => {
583583
assert(err instanceof Error);
584-
assert.equal(err.code, FAKE_STATUS_CODE);
584+
assert.strictEqual(err.code, FAKE_STATUS_CODE);
585585
assert(typeof response === 'undefined');
586586
done();
587587
});
@@ -642,7 +642,7 @@ describe('PublisherClient', () => {
642642

643643
client.testIamPermissions(request, (err, response) => {
644644
assert(err instanceof Error);
645-
assert.equal(err.code, FAKE_STATUS_CODE);
645+
assert.strictEqual(err.code, FAKE_STATUS_CODE);
646646
assert(typeof response === 'undefined');
647647
done();
648648
});
@@ -719,7 +719,7 @@ describe('SubscriberClient', () => {
719719

720720
client.createSubscription(request, (err, response) => {
721721
assert(err instanceof Error);
722-
assert.equal(err.code, FAKE_STATUS_CODE);
722+
assert.strictEqual(err.code, FAKE_STATUS_CODE);
723723
assert(typeof response === 'undefined');
724724
done();
725725
});
@@ -791,7 +791,7 @@ describe('SubscriberClient', () => {
791791

792792
client.getSubscription(request, (err, response) => {
793793
assert(err instanceof Error);
794-
assert.equal(err.code, FAKE_STATUS_CODE);
794+
assert.strictEqual(err.code, FAKE_STATUS_CODE);
795795
assert(typeof response === 'undefined');
796796
done();
797797
});
@@ -875,7 +875,7 @@ describe('SubscriberClient', () => {
875875

876876
client.updateSubscription(request, (err, response) => {
877877
assert(err instanceof Error);
878-
assert.equal(err.code, FAKE_STATUS_CODE);
878+
assert.strictEqual(err.code, FAKE_STATUS_CODE);
879879
assert(typeof response === 'undefined');
880880
done();
881881
});
@@ -942,7 +942,7 @@ describe('SubscriberClient', () => {
942942

943943
client.listSubscriptions(request, (err, response) => {
944944
assert(err instanceof Error);
945-
assert.equal(err.code, FAKE_STATUS_CODE);
945+
assert.strictEqual(err.code, FAKE_STATUS_CODE);
946946
assert(typeof response === 'undefined');
947947
done();
948948
});
@@ -998,7 +998,7 @@ describe('SubscriberClient', () => {
998998

999999
client.deleteSubscription(request, err => {
10001000
assert(err instanceof Error);
1001-
assert.equal(err.code, FAKE_STATUS_CODE);
1001+
assert.strictEqual(err.code, FAKE_STATUS_CODE);
10021002
done();
10031003
});
10041004
});
@@ -1061,7 +1061,7 @@ describe('SubscriberClient', () => {
10611061

10621062
client.modifyAckDeadline(request, err => {
10631063
assert(err instanceof Error);
1064-
assert.equal(err.code, FAKE_STATUS_CODE);
1064+
assert.strictEqual(err.code, FAKE_STATUS_CODE);
10651065
done();
10661066
});
10671067
});
@@ -1120,7 +1120,7 @@ describe('SubscriberClient', () => {
11201120

11211121
client.acknowledge(request, err => {
11221122
assert(err instanceof Error);
1123-
assert.equal(err.code, FAKE_STATUS_CODE);
1123+
assert.strictEqual(err.code, FAKE_STATUS_CODE);
11241124
done();
11251125
});
11261126
});
@@ -1182,7 +1182,7 @@ describe('SubscriberClient', () => {
11821182

11831183
client.pull(request, (err, response) => {
11841184
assert(err instanceof Error);
1185-
assert.equal(err.code, FAKE_STATUS_CODE);
1185+
assert.strictEqual(err.code, FAKE_STATUS_CODE);
11861186
assert(typeof response === 'undefined');
11871187
done();
11881188
});
@@ -1264,7 +1264,7 @@ describe('SubscriberClient', () => {
12641264
})
12651265
.on('error', err => {
12661266
assert(err instanceof Error);
1267-
assert.equal(err.code, FAKE_STATUS_CODE);
1267+
assert.strictEqual(err.code, FAKE_STATUS_CODE);
12681268
done();
12691269
});
12701270

@@ -1325,7 +1325,7 @@ describe('SubscriberClient', () => {
13251325

13261326
client.modifyPushConfig(request, err => {
13271327
assert(err instanceof Error);
1328-
assert.equal(err.code, FAKE_STATUS_CODE);
1328+
assert.strictEqual(err.code, FAKE_STATUS_CODE);
13291329
done();
13301330
});
13311331
});
@@ -1391,7 +1391,7 @@ describe('SubscriberClient', () => {
13911391

13921392
client.listSnapshots(request, (err, response) => {
13931393
assert(err instanceof Error);
1394-
assert.equal(err.code, FAKE_STATUS_CODE);
1394+
assert.strictEqual(err.code, FAKE_STATUS_CODE);
13951395
assert(typeof response === 'undefined');
13961396
done();
13971397
});
@@ -1463,7 +1463,7 @@ describe('SubscriberClient', () => {
14631463

14641464
client.createSnapshot(request, (err, response) => {
14651465
assert(err instanceof Error);
1466-
assert.equal(err.code, FAKE_STATUS_CODE);
1466+
assert.strictEqual(err.code, FAKE_STATUS_CODE);
14671467
assert(typeof response === 'undefined');
14681468
done();
14691469
});
@@ -1549,7 +1549,7 @@ describe('SubscriberClient', () => {
15491549

15501550
client.updateSnapshot(request, (err, response) => {
15511551
assert(err instanceof Error);
1552-
assert.equal(err.code, FAKE_STATUS_CODE);
1552+
assert.strictEqual(err.code, FAKE_STATUS_CODE);
15531553
assert(typeof response === 'undefined');
15541554
done();
15551555
});
@@ -1599,7 +1599,7 @@ describe('SubscriberClient', () => {
15991599

16001600
client.deleteSnapshot(request, err => {
16011601
assert(err instanceof Error);
1602-
assert.equal(err.code, FAKE_STATUS_CODE);
1602+
assert.strictEqual(err.code, FAKE_STATUS_CODE);
16031603
done();
16041604
});
16051605
});
@@ -1657,7 +1657,7 @@ describe('SubscriberClient', () => {
16571657

16581658
client.seek(request, (err, response) => {
16591659
assert(err instanceof Error);
1660-
assert.equal(err.code, FAKE_STATUS_CODE);
1660+
assert.strictEqual(err.code, FAKE_STATUS_CODE);
16611661
assert(typeof response === 'undefined');
16621662
done();
16631663
});
@@ -1729,7 +1729,7 @@ describe('SubscriberClient', () => {
17291729

17301730
client.setIamPolicy(request, (err, response) => {
17311731
assert(err instanceof Error);
1732-
assert.equal(err.code, FAKE_STATUS_CODE);
1732+
assert.strictEqual(err.code, FAKE_STATUS_CODE);
17331733
assert(typeof response === 'undefined');
17341734
done();
17351735
});
@@ -1797,7 +1797,7 @@ describe('SubscriberClient', () => {
17971797

17981798
client.getIamPolicy(request, (err, response) => {
17991799
assert(err instanceof Error);
1800-
assert.equal(err.code, FAKE_STATUS_CODE);
1800+
assert.strictEqual(err.code, FAKE_STATUS_CODE);
18011801
assert(typeof response === 'undefined');
18021802
done();
18031803
});
@@ -1864,7 +1864,7 @@ describe('SubscriberClient', () => {
18641864

18651865
client.testIamPermissions(request, (err, response) => {
18661866
assert(err instanceof Error);
1867-
assert.equal(err.code, FAKE_STATUS_CODE);
1867+
assert.strictEqual(err.code, FAKE_STATUS_CODE);
18681868
assert(typeof response === 'undefined');
18691869
done();
18701870
});

handwritten/pubsub/test/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ var fakePaginator = {
8282
}
8383

8484
methods = arrify(methods);
85-
assert.equal(Class.name, 'PubSub');
85+
assert.strictEqual(Class.name, 'PubSub');
8686
assert.deepEqual(methods, [
8787
'getSnapshots',
8888
'getSubscriptions',
@@ -1300,7 +1300,7 @@ describe('PubSub', function() {
13001300

13011301
it('should pass specified name to the Subscription', function(done) {
13021302
SubscriptionOverride = function(pubsub, name) {
1303-
assert.equal(name, SUB_NAME);
1303+
assert.strictEqual(name, SUB_NAME);
13041304
done();
13051305
};
13061306
pubsub.subscription(SUB_NAME);

handwritten/pubsub/test/subscription.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,12 @@ describe('Subscription', function() {
196196
describe('formatName_', function() {
197197
it('should format name', function() {
198198
var formattedName = Subscription.formatName_(PROJECT_ID, SUB_NAME);
199-
assert.equal(formattedName, SUB_FULL_NAME);
199+
assert.strictEqual(formattedName, SUB_FULL_NAME);
200200
});
201201

202202
it('should format name when given a complete name', function() {
203203
var formattedName = Subscription.formatName_(PROJECT_ID, SUB_FULL_NAME);
204-
assert.equal(formattedName, SUB_FULL_NAME);
204+
assert.strictEqual(formattedName, SUB_FULL_NAME);
205205
});
206206
});
207207

handwritten/pubsub/test/topic.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,12 @@ describe('Topic', function() {
143143
describe('formatName_', function() {
144144
it('should format name', function() {
145145
var formattedName = Topic.formatName_(PROJECT_ID, TOPIC_UNFORMATTED_NAME);
146-
assert.equal(formattedName, TOPIC_NAME);
146+
assert.strictEqual(formattedName, TOPIC_NAME);
147147
});
148148

149149
it('should format name when given a complete name', function() {
150150
var formattedName = Topic.formatName_(PROJECT_ID, TOPIC_NAME);
151-
assert.equal(formattedName, TOPIC_NAME);
151+
assert.strictEqual(formattedName, TOPIC_NAME);
152152
});
153153
});
154154

@@ -523,7 +523,7 @@ describe('Topic', function() {
523523
var opts = {};
524524

525525
topic.parent.subscription = function(name, options) {
526-
assert.equal(name, subscriptionName);
526+
assert.strictEqual(name, subscriptionName);
527527
assert.deepEqual(options, opts);
528528
done();
529529
};

0 commit comments

Comments
 (0)