Skip to content

Commit 7e19a94

Browse files
JustinBeckwithjkwlui
authored andcommitted
test: use strictEqual in tests (#250)
1 parent ad91fd8 commit 7e19a94

File tree

5 files changed

+71
-71
lines changed

5 files changed

+71
-71
lines changed

handwritten/bigtable/system-test/bigtable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ describe('Bigtable', function() {
554554
assert.ifError(err);
555555
var maxAge = metadata.gcRule.maxAge;
556556

557-
assert.equal(maxAge.seconds, rule.age.seconds);
557+
assert.strictEqual(maxAge.seconds, rule.age.seconds);
558558
assert.strictEqual(maxAge.nanas, rule.age.nanas);
559559
done();
560560
});

handwritten/bigtable/system-test/read-rows-acceptance-tests.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ describe('Read Row Acceptance tests', function() {
126126
verify();
127127
});
128128
function verify() {
129-
assert.equal(errors.length, errorCount, ' error count mismatch');
130-
assert.equal(rows.length, results.length, 'row count mismatch');
129+
assert.strictEqual(errors.length, errorCount, ' error count mismatch');
130+
assert.strictEqual(rows.length, results.length, 'row count mismatch');
131131
assert.deepEqual(rows, tableRows, 'row mismatch');
132132
done();
133133
}

handwritten/bigtable/test/chunktransformer.js

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ describe('Bigtable/ChunkTransformer', function() {
185185
chunkTransformer.processNewRow(chunk);
186186
assert(resetSpy.called, 'reset state failed');
187187
assert(commitSpy.called, 'commit row failed');
188-
assert.equal(
188+
assert.strictEqual(
189189
chunkTransformer.prevRowKey,
190190
chunk.rowKey,
191191
'wrong state prevrowkey'
@@ -220,7 +220,7 @@ describe('Bigtable/ChunkTransformer', function() {
220220
chunkTransformer.processNewRow(chunk);
221221
assert(!resetSpy.called, 'invalid call to reset');
222222
assert(!commitSpy.called, 'inavlid call to commit');
223-
assert.equal(rows.length, 0, 'wrong call to push');
223+
assert.strictEqual(rows.length, 0, 'wrong call to push');
224224
let partialRow = {
225225
key: chunk.rowKey,
226226
data: {
@@ -236,7 +236,7 @@ describe('Bigtable/ChunkTransformer', function() {
236236
},
237237
};
238238
assert.deepEqual(chunkTransformer.row, partialRow);
239-
assert.equal(
239+
assert.strictEqual(
240240
chunkTransformer.state,
241241
RowStateEnum.ROW_IN_PROGRESS,
242242
'wrong state'
@@ -256,7 +256,7 @@ describe('Bigtable/ChunkTransformer', function() {
256256
chunkTransformer.processNewRow(chunk);
257257
assert(!resetSpy.called, 'invalid call to reset');
258258
assert(!commitSpy.called, 'inavlid call to commit');
259-
assert.equal(rows.length, 0, 'wrong call to push');
259+
assert.strictEqual(rows.length, 0, 'wrong call to push');
260260
let partialRow = {
261261
key: chunk.rowKey,
262262
data: {
@@ -272,7 +272,7 @@ describe('Bigtable/ChunkTransformer', function() {
272272
},
273273
};
274274
assert.deepEqual(chunkTransformer.row, partialRow);
275-
assert.equal(
275+
assert.strictEqual(
276276
chunkTransformer.state,
277277
RowStateEnum.CELL_IN_PROGRESS,
278278
'wrong state'
@@ -374,7 +374,7 @@ describe('Bigtable/ChunkTransformer', function() {
374374
const chunk = {resetRow: true};
375375
chunkTransformer.processRowInProgress(chunk);
376376
assert(resetSpy.called, 'Did not reset');
377-
assert.equal(rows.length, 0, 'wrong call to push');
377+
assert.strictEqual(rows.length, 0, 'wrong call to push');
378378
assert(!commitSpy.called, 'unexpected commit');
379379
});
380380
it('bare commitRow should produce qualifer ', function() {
@@ -391,7 +391,7 @@ describe('Bigtable/ChunkTransformer', function() {
391391
chunkTransformer.processRowInProgress(chunk);
392392
assert(commitSpy.called, 'did not call commit');
393393
assert(resetSpy.called, 'did not call reset');
394-
assert.equal(rows.length, 1, 'wrong call to push');
394+
assert.strictEqual(rows.length, 1, 'wrong call to push');
395395
const expectedRow = {
396396
key: 'key',
397397
data: {
@@ -408,7 +408,7 @@ describe('Bigtable/ChunkTransformer', function() {
408408
};
409409
const row = rows[0];
410410
assert.deepEqual(row, expectedRow, 'row mismatch');
411-
assert.equal(
411+
assert.strictEqual(
412412
chunkTransformer.state,
413413
RowStateEnum.NEW_ROW,
414414
'state mismatch'
@@ -436,7 +436,7 @@ describe('Bigtable/ChunkTransformer', function() {
436436
chunkTransformer.processRowInProgress(chunk);
437437
assert(commitSpy.called, 'did not call commit');
438438
assert(resetSpy.called, 'did not call reset');
439-
assert.equal(rows.length, 1, 'wrong call to push');
439+
assert.strictEqual(rows.length, 1, 'wrong call to push');
440440
const expectedRow = {
441441
key: 'key',
442442
data: {
@@ -454,7 +454,7 @@ describe('Bigtable/ChunkTransformer', function() {
454454
};
455455
const row = rows[0];
456456
assert.deepEqual(row, expectedRow, 'row mismatch');
457-
assert.equal(
457+
assert.strictEqual(
458458
chunkTransformer.state,
459459
RowStateEnum.NEW_ROW,
460460
'state mismatch'
@@ -483,7 +483,7 @@ describe('Bigtable/ChunkTransformer', function() {
483483
chunkTransformer.processRowInProgress(chunk);
484484
assert(commitSpy.called, 'did not call commit');
485485
assert(resetSpy.called, 'did not call reset');
486-
assert.equal(rows.length, 1, 'wrong call to push');
486+
assert.strictEqual(rows.length, 1, 'wrong call to push');
487487
const expectedRow = {
488488
key: 'key',
489489
data: {
@@ -503,7 +503,7 @@ describe('Bigtable/ChunkTransformer', function() {
503503
};
504504
const row = rows[0];
505505
assert.deepEqual(row, expectedRow, 'row mismatch');
506-
assert.equal(
506+
assert.strictEqual(
507507
chunkTransformer.state,
508508
RowStateEnum.NEW_ROW,
509509
'state mismatch'
@@ -529,7 +529,7 @@ describe('Bigtable/ChunkTransformer', function() {
529529
chunkTransformer.processRowInProgress(chunk);
530530
assert(!commitSpy.called, 'invalid call to commit');
531531
assert(!resetSpy.called, 'invalid call to reset');
532-
assert.equal(rows.length, 0, 'wrong call to push');
532+
assert.strictEqual(rows.length, 0, 'wrong call to push');
533533
const expectedState = {
534534
key: 'key',
535535
data: {
@@ -549,7 +549,7 @@ describe('Bigtable/ChunkTransformer', function() {
549549
expectedState,
550550
'row state mismatch'
551551
);
552-
assert.equal(
552+
assert.strictEqual(
553553
chunkTransformer.state,
554554
RowStateEnum.CELL_IN_PROGRESS,
555555
'state mismatch'
@@ -581,7 +581,7 @@ describe('Bigtable/ChunkTransformer', function() {
581581
chunkTransformer.processRowInProgress(chunk);
582582
assert(!resetSpy.called, 'invalid call to reset');
583583
assert(!commitSpy.called, 'invalid call to commit');
584-
assert.equal(rows.length, 0, 'wrong call to push');
584+
assert.strictEqual(rows.length, 0, 'wrong call to push');
585585
const expectedState = {
586586
key: 'key',
587587
data: {
@@ -597,7 +597,7 @@ describe('Bigtable/ChunkTransformer', function() {
597597
},
598598
};
599599
assert.deepEqual(chunkTransformer.row, expectedState, 'row mismatch');
600-
assert.equal(
600+
assert.strictEqual(
601601
chunkTransformer.state,
602602
RowStateEnum.ROW_IN_PROGRESS,
603603
'state mismatch'
@@ -683,7 +683,7 @@ describe('Bigtable/ChunkTransformer', function() {
683683
chunkTransformer.processCellInProgress(chunk);
684684
assert(resetSpy.called, 'did not call reset');
685685
assert(!commitSpy.called, 'unexpected call to commit');
686-
assert.equal(rows.length, 0, 'wrong call to push');
686+
assert.strictEqual(rows.length, 0, 'wrong call to push');
687687
});
688688
it('should produce row on commitRow', function() {
689689
chunkTransformer.qualifier = {
@@ -710,7 +710,7 @@ describe('Bigtable/ChunkTransformer', function() {
710710
chunkTransformer.processCellInProgress(chunk);
711711
assert(commitSpy.called, 'did not call commit');
712712
assert(resetSpy.called, 'did not call reste');
713-
assert.equal(rows.length, 1, 'wrong call to push');
713+
assert.strictEqual(rows.length, 1, 'wrong call to push');
714714
const expectedRow = {
715715
key: 'key',
716716
data: {
@@ -728,7 +728,7 @@ describe('Bigtable/ChunkTransformer', function() {
728728
};
729729
const row = rows[0];
730730
assert.deepEqual(row, expectedRow, 'row mismatch');
731-
assert.equal(
731+
assert.strictEqual(
732732
chunkTransformer.state,
733733
RowStateEnum.NEW_ROW,
734734
'state mismatch'
@@ -759,7 +759,7 @@ describe('Bigtable/ChunkTransformer', function() {
759759
chunkTransformer.processCellInProgress(chunk);
760760
assert(!resetSpy.called, 'invalid call to reset');
761761
assert(!commitSpy.called, 'invalid call to commit');
762-
assert.equal(rows.length, 0, 'wrong call to push');
762+
assert.strictEqual(rows.length, 0, 'wrong call to push');
763763
const expectedState = {
764764
key: 'key',
765765
data: {
@@ -776,7 +776,7 @@ describe('Bigtable/ChunkTransformer', function() {
776776
},
777777
};
778778
assert.deepEqual(chunkTransformer.row, expectedState, 'row mismatch');
779-
assert.equal(
779+
assert.strictEqual(
780780
chunkTransformer.state,
781781
RowStateEnum.ROW_IN_PROGRESS,
782782
'state mismatch'
@@ -815,7 +815,7 @@ describe('Bigtable/ChunkTransformer', function() {
815815
chunkTransformer.processCellInProgress(chunk);
816816
assert(!resetSpy.called, 'invalid call to reset');
817817
assert(!commitSpy.called, 'invalid call to commit');
818-
assert.equal(rows.length, 0, 'wrong call to push');
818+
assert.strictEqual(rows.length, 0, 'wrong call to push');
819819
const expectedState = {
820820
key: 'key',
821821
data: {
@@ -835,7 +835,7 @@ describe('Bigtable/ChunkTransformer', function() {
835835
},
836836
};
837837
assert.deepEqual(chunkTransformer.row, expectedState, 'row mismatch');
838-
assert.equal(
838+
assert.strictEqual(
839839
chunkTransformer.state,
840840
RowStateEnum.ROW_IN_PROGRESS,
841841
'state mismatch'
@@ -1055,7 +1055,7 @@ describe('Bigtable/ChunkTransformer', function() {
10551055
};
10561056
chunkTransformer.moveToNextState(chunk);
10571057
assert(commitSpy.called, 'did not call commit');
1058-
assert.equal(rows.length, 1, 'did not call push');
1058+
assert.strictEqual(rows.length, 1, 'did not call push');
10591059
const expectedRow = {
10601060
key: 'key',
10611061
data: {
@@ -1073,7 +1073,7 @@ describe('Bigtable/ChunkTransformer', function() {
10731073
};
10741074
const row = rows[0];
10751075
assert.deepEqual(row, expectedRow, 'row mismatch');
1076-
assert.equal(
1076+
assert.strictEqual(
10771077
chunkTransformer.state,
10781078
RowStateEnum.NEW_ROW,
10791079
'state mismatch'
@@ -1087,8 +1087,8 @@ describe('Bigtable/ChunkTransformer', function() {
10871087
chunkTransformer.state = RowStateEnum.NEW_ROW;
10881088
chunkTransformer.moveToNextState(chunk);
10891089
assert(!commitSpy.called, 'did not call commit');
1090-
assert.equal(rows.length, 0, 'unexpected call to push');
1091-
assert.equal(
1090+
assert.strictEqual(rows.length, 0, 'unexpected call to push');
1091+
assert.strictEqual(
10921092
chunkTransformer.state,
10931093
RowStateEnum.CELL_IN_PROGRESS,
10941094
'wrong state'
@@ -1102,8 +1102,8 @@ describe('Bigtable/ChunkTransformer', function() {
11021102
chunkTransformer.state = RowStateEnum.CELL_IN_PROGRESS;
11031103
chunkTransformer.moveToNextState(chunk);
11041104
assert(!commitSpy.called, 'did not call commit');
1105-
assert.equal(rows.length, 0, 'unexpected call to push');
1106-
assert.equal(
1105+
assert.strictEqual(rows.length, 0, 'unexpected call to push');
1106+
assert.strictEqual(
11071107
chunkTransformer.state,
11081108
RowStateEnum.ROW_IN_PROGRESS,
11091109
'wrong state'
@@ -1114,7 +1114,7 @@ describe('Bigtable/ChunkTransformer', function() {
11141114
it('should emit error when destroy is called with error', function(done) {
11151115
const error = new Error('destroy error');
11161116
chunkTransformer.on('error', function(err) {
1117-
assert.equal(err, error, 'did not emit error');
1117+
assert.strictEqual(err, error, 'did not emit error');
11181118
done();
11191119
});
11201120
chunkTransformer.destroy(error);

0 commit comments

Comments
 (0)