Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: use strictEqual in tests #250

Merged
merged 1 commit into from
Jul 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion system-test/bigtable.js
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ describe('Bigtable', function() {
assert.ifError(err);
var maxAge = metadata.gcRule.maxAge;

assert.equal(maxAge.seconds, rule.age.seconds);
assert.strictEqual(maxAge.seconds, rule.age.seconds);
assert.strictEqual(maxAge.nanas, rule.age.nanas);
done();
});
Expand Down
4 changes: 2 additions & 2 deletions system-test/read-rows-acceptance-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ describe('Read Row Acceptance tests', function() {
verify();
});
function verify() {
assert.equal(errors.length, errorCount, ' error count mismatch');
assert.equal(rows.length, results.length, 'row count mismatch');
assert.strictEqual(errors.length, errorCount, ' error count mismatch');
assert.strictEqual(rows.length, results.length, 'row count mismatch');
assert.deepEqual(rows, tableRows, 'row mismatch');
done();
}
Expand Down
60 changes: 30 additions & 30 deletions test/chunktransformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ describe('Bigtable/ChunkTransformer', function() {
chunkTransformer.processNewRow(chunk);
assert(resetSpy.called, 'reset state failed');
assert(commitSpy.called, 'commit row failed');
assert.equal(
assert.strictEqual(
chunkTransformer.prevRowKey,
chunk.rowKey,
'wrong state prevrowkey'
Expand Down Expand Up @@ -220,7 +220,7 @@ describe('Bigtable/ChunkTransformer', function() {
chunkTransformer.processNewRow(chunk);
assert(!resetSpy.called, 'invalid call to reset');
assert(!commitSpy.called, 'inavlid call to commit');
assert.equal(rows.length, 0, 'wrong call to push');
assert.strictEqual(rows.length, 0, 'wrong call to push');
let partialRow = {
key: chunk.rowKey,
data: {
Expand All @@ -236,7 +236,7 @@ describe('Bigtable/ChunkTransformer', function() {
},
};
assert.deepEqual(chunkTransformer.row, partialRow);
assert.equal(
assert.strictEqual(
chunkTransformer.state,
RowStateEnum.ROW_IN_PROGRESS,
'wrong state'
Expand All @@ -256,7 +256,7 @@ describe('Bigtable/ChunkTransformer', function() {
chunkTransformer.processNewRow(chunk);
assert(!resetSpy.called, 'invalid call to reset');
assert(!commitSpy.called, 'inavlid call to commit');
assert.equal(rows.length, 0, 'wrong call to push');
assert.strictEqual(rows.length, 0, 'wrong call to push');
let partialRow = {
key: chunk.rowKey,
data: {
Expand All @@ -272,7 +272,7 @@ describe('Bigtable/ChunkTransformer', function() {
},
};
assert.deepEqual(chunkTransformer.row, partialRow);
assert.equal(
assert.strictEqual(
chunkTransformer.state,
RowStateEnum.CELL_IN_PROGRESS,
'wrong state'
Expand Down Expand Up @@ -374,7 +374,7 @@ describe('Bigtable/ChunkTransformer', function() {
const chunk = {resetRow: true};
chunkTransformer.processRowInProgress(chunk);
assert(resetSpy.called, 'Did not reset');
assert.equal(rows.length, 0, 'wrong call to push');
assert.strictEqual(rows.length, 0, 'wrong call to push');
assert(!commitSpy.called, 'unexpected commit');
});
it('bare commitRow should produce qualifer ', function() {
Expand All @@ -391,7 +391,7 @@ describe('Bigtable/ChunkTransformer', function() {
chunkTransformer.processRowInProgress(chunk);
assert(commitSpy.called, 'did not call commit');
assert(resetSpy.called, 'did not call reset');
assert.equal(rows.length, 1, 'wrong call to push');
assert.strictEqual(rows.length, 1, 'wrong call to push');
const expectedRow = {
key: 'key',
data: {
Expand All @@ -408,7 +408,7 @@ describe('Bigtable/ChunkTransformer', function() {
};
const row = rows[0];
assert.deepEqual(row, expectedRow, 'row mismatch');
assert.equal(
assert.strictEqual(
chunkTransformer.state,
RowStateEnum.NEW_ROW,
'state mismatch'
Expand Down Expand Up @@ -436,7 +436,7 @@ describe('Bigtable/ChunkTransformer', function() {
chunkTransformer.processRowInProgress(chunk);
assert(commitSpy.called, 'did not call commit');
assert(resetSpy.called, 'did not call reset');
assert.equal(rows.length, 1, 'wrong call to push');
assert.strictEqual(rows.length, 1, 'wrong call to push');
const expectedRow = {
key: 'key',
data: {
Expand All @@ -454,7 +454,7 @@ describe('Bigtable/ChunkTransformer', function() {
};
const row = rows[0];
assert.deepEqual(row, expectedRow, 'row mismatch');
assert.equal(
assert.strictEqual(
chunkTransformer.state,
RowStateEnum.NEW_ROW,
'state mismatch'
Expand Down Expand Up @@ -483,7 +483,7 @@ describe('Bigtable/ChunkTransformer', function() {
chunkTransformer.processRowInProgress(chunk);
assert(commitSpy.called, 'did not call commit');
assert(resetSpy.called, 'did not call reset');
assert.equal(rows.length, 1, 'wrong call to push');
assert.strictEqual(rows.length, 1, 'wrong call to push');
const expectedRow = {
key: 'key',
data: {
Expand All @@ -503,7 +503,7 @@ describe('Bigtable/ChunkTransformer', function() {
};
const row = rows[0];
assert.deepEqual(row, expectedRow, 'row mismatch');
assert.equal(
assert.strictEqual(
chunkTransformer.state,
RowStateEnum.NEW_ROW,
'state mismatch'
Expand All @@ -529,7 +529,7 @@ describe('Bigtable/ChunkTransformer', function() {
chunkTransformer.processRowInProgress(chunk);
assert(!commitSpy.called, 'invalid call to commit');
assert(!resetSpy.called, 'invalid call to reset');
assert.equal(rows.length, 0, 'wrong call to push');
assert.strictEqual(rows.length, 0, 'wrong call to push');
const expectedState = {
key: 'key',
data: {
Expand All @@ -549,7 +549,7 @@ describe('Bigtable/ChunkTransformer', function() {
expectedState,
'row state mismatch'
);
assert.equal(
assert.strictEqual(
chunkTransformer.state,
RowStateEnum.CELL_IN_PROGRESS,
'state mismatch'
Expand Down Expand Up @@ -581,7 +581,7 @@ describe('Bigtable/ChunkTransformer', function() {
chunkTransformer.processRowInProgress(chunk);
assert(!resetSpy.called, 'invalid call to reset');
assert(!commitSpy.called, 'invalid call to commit');
assert.equal(rows.length, 0, 'wrong call to push');
assert.strictEqual(rows.length, 0, 'wrong call to push');
const expectedState = {
key: 'key',
data: {
Expand All @@ -597,7 +597,7 @@ describe('Bigtable/ChunkTransformer', function() {
},
};
assert.deepEqual(chunkTransformer.row, expectedState, 'row mismatch');
assert.equal(
assert.strictEqual(
chunkTransformer.state,
RowStateEnum.ROW_IN_PROGRESS,
'state mismatch'
Expand Down Expand Up @@ -683,7 +683,7 @@ describe('Bigtable/ChunkTransformer', function() {
chunkTransformer.processCellInProgress(chunk);
assert(resetSpy.called, 'did not call reset');
assert(!commitSpy.called, 'unexpected call to commit');
assert.equal(rows.length, 0, 'wrong call to push');
assert.strictEqual(rows.length, 0, 'wrong call to push');
});
it('should produce row on commitRow', function() {
chunkTransformer.qualifier = {
Expand All @@ -710,7 +710,7 @@ describe('Bigtable/ChunkTransformer', function() {
chunkTransformer.processCellInProgress(chunk);
assert(commitSpy.called, 'did not call commit');
assert(resetSpy.called, 'did not call reste');
assert.equal(rows.length, 1, 'wrong call to push');
assert.strictEqual(rows.length, 1, 'wrong call to push');
const expectedRow = {
key: 'key',
data: {
Expand All @@ -728,7 +728,7 @@ describe('Bigtable/ChunkTransformer', function() {
};
const row = rows[0];
assert.deepEqual(row, expectedRow, 'row mismatch');
assert.equal(
assert.strictEqual(
chunkTransformer.state,
RowStateEnum.NEW_ROW,
'state mismatch'
Expand Down Expand Up @@ -759,7 +759,7 @@ describe('Bigtable/ChunkTransformer', function() {
chunkTransformer.processCellInProgress(chunk);
assert(!resetSpy.called, 'invalid call to reset');
assert(!commitSpy.called, 'invalid call to commit');
assert.equal(rows.length, 0, 'wrong call to push');
assert.strictEqual(rows.length, 0, 'wrong call to push');
const expectedState = {
key: 'key',
data: {
Expand All @@ -776,7 +776,7 @@ describe('Bigtable/ChunkTransformer', function() {
},
};
assert.deepEqual(chunkTransformer.row, expectedState, 'row mismatch');
assert.equal(
assert.strictEqual(
chunkTransformer.state,
RowStateEnum.ROW_IN_PROGRESS,
'state mismatch'
Expand Down Expand Up @@ -815,7 +815,7 @@ describe('Bigtable/ChunkTransformer', function() {
chunkTransformer.processCellInProgress(chunk);
assert(!resetSpy.called, 'invalid call to reset');
assert(!commitSpy.called, 'invalid call to commit');
assert.equal(rows.length, 0, 'wrong call to push');
assert.strictEqual(rows.length, 0, 'wrong call to push');
const expectedState = {
key: 'key',
data: {
Expand All @@ -835,7 +835,7 @@ describe('Bigtable/ChunkTransformer', function() {
},
};
assert.deepEqual(chunkTransformer.row, expectedState, 'row mismatch');
assert.equal(
assert.strictEqual(
chunkTransformer.state,
RowStateEnum.ROW_IN_PROGRESS,
'state mismatch'
Expand Down Expand Up @@ -1055,7 +1055,7 @@ describe('Bigtable/ChunkTransformer', function() {
};
chunkTransformer.moveToNextState(chunk);
assert(commitSpy.called, 'did not call commit');
assert.equal(rows.length, 1, 'did not call push');
assert.strictEqual(rows.length, 1, 'did not call push');
const expectedRow = {
key: 'key',
data: {
Expand All @@ -1073,7 +1073,7 @@ describe('Bigtable/ChunkTransformer', function() {
};
const row = rows[0];
assert.deepEqual(row, expectedRow, 'row mismatch');
assert.equal(
assert.strictEqual(
chunkTransformer.state,
RowStateEnum.NEW_ROW,
'state mismatch'
Expand All @@ -1087,8 +1087,8 @@ describe('Bigtable/ChunkTransformer', function() {
chunkTransformer.state = RowStateEnum.NEW_ROW;
chunkTransformer.moveToNextState(chunk);
assert(!commitSpy.called, 'did not call commit');
assert.equal(rows.length, 0, 'unexpected call to push');
assert.equal(
assert.strictEqual(rows.length, 0, 'unexpected call to push');
assert.strictEqual(
chunkTransformer.state,
RowStateEnum.CELL_IN_PROGRESS,
'wrong state'
Expand All @@ -1102,8 +1102,8 @@ describe('Bigtable/ChunkTransformer', function() {
chunkTransformer.state = RowStateEnum.CELL_IN_PROGRESS;
chunkTransformer.moveToNextState(chunk);
assert(!commitSpy.called, 'did not call commit');
assert.equal(rows.length, 0, 'unexpected call to push');
assert.equal(
assert.strictEqual(rows.length, 0, 'unexpected call to push');
assert.strictEqual(
chunkTransformer.state,
RowStateEnum.ROW_IN_PROGRESS,
'wrong state'
Expand All @@ -1114,7 +1114,7 @@ describe('Bigtable/ChunkTransformer', function() {
it('should emit error when destroy is called with error', function(done) {
const error = new Error('destroy error');
chunkTransformer.on('error', function(err) {
assert.equal(err, error, 'did not emit error');
assert.strictEqual(err, error, 'did not emit error');
done();
});
chunkTransformer.destroy(error);
Expand Down
Loading