Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Commit

Permalink
Replace assert.equal with assert.strictEqual (#562)
Browse files Browse the repository at this point in the history
* replace assert.equal with assert.strictEqual

* Fix build
  • Loading branch information
mayurkale22 authored May 29, 2019
1 parent 367db52 commit 20e4cf0
Show file tree
Hide file tree
Showing 37 changed files with 365 additions and 351 deletions.
2 changes: 1 addition & 1 deletion packages/opencensus-core/test/test-binary-serializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ describe('Binary Format Serializer', () => {
0x02, 0x76, 0x32
]);
const tags = deserializeBinary(buff);
assert.equal(tags.tags.size, 1);
assert.strictEqual(tags.tags.size, 1);
assert.deepStrictEqual(tags, expectedTags);
});
});
Expand Down
16 changes: 8 additions & 8 deletions packages/opencensus-core/test/test-console-logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('ConsoleLogger', () => {
describe('new ConsoleLogger()', () => {
it('should log with default levels', () => {
logger.logger();
assert.equal(LEVELS.length, ConsoleLogger.LEVELS.length);
assert.strictEqual(LEVELS.length, ConsoleLogger.LEVELS.length);
});

it('should log with error', () => {
Expand Down Expand Up @@ -65,7 +65,7 @@ describe('ConsoleLogger', () => {

const validateString = consoleTxt.indexOf('warn');

assert.equal(validateString, -1);
assert.strictEqual(validateString, -1);
});

it('should not log info', () => {
Expand All @@ -75,7 +75,7 @@ describe('ConsoleLogger', () => {

const validateString = consoleTxt.indexOf('info');

assert.equal(validateString, -1);
assert.strictEqual(validateString, -1);
});

it('should not log debug', () => {
Expand All @@ -84,7 +84,7 @@ describe('ConsoleLogger', () => {
unhookIntercept();
const validateString = consoleTxt.indexOf('debug');

assert.equal(validateString, -1);
assert.strictEqual(validateString, -1);
});
});

Expand All @@ -98,7 +98,7 @@ describe('ConsoleLogger', () => {
unhookIntercept();
const validateString = consoleTxt.indexOf('error');

assert.equal(validateString, -1);
assert.strictEqual(validateString, -1);
});

it('should not log warn', () => {
Expand All @@ -108,7 +108,7 @@ describe('ConsoleLogger', () => {

const validateString = consoleTxt.indexOf('warn');

assert.equal(validateString, -1);
assert.strictEqual(validateString, -1);
});

it('should not log info', () => {
Expand All @@ -118,7 +118,7 @@ describe('ConsoleLogger', () => {

const validateString = consoleTxt.indexOf('info');

assert.equal(validateString, -1);
assert.strictEqual(validateString, -1);
});

it('should not log debug', () => {
Expand All @@ -127,7 +127,7 @@ describe('ConsoleLogger', () => {
unhookIntercept();
const validateString = consoleTxt.indexOf('debug');

assert.equal(validateString, -1);
assert.strictEqual(validateString, -1);
});
});
});
26 changes: 13 additions & 13 deletions packages/opencensus-core/test/test-cumulative.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ describe('CUMULATIVE', () => {

let metric = instance.getMetric();
assert.deepStrictEqual(metric!.descriptor, expectedMetricDescriptor);
assert.equal(metric!.timeseries.length, 1);
assert.strictEqual(metric!.timeseries.length, 1);
assert.deepStrictEqual(metric!.timeseries, [{
labelValues: LABEL_VALUES_200,
points: [{value: 1, timestamp: mockedTime}],
Expand All @@ -86,7 +86,7 @@ describe('CUMULATIVE', () => {
point1.inc();
metric = instance.getMetric();
assert.deepStrictEqual(metric!.descriptor, expectedMetricDescriptor);
assert.equal(metric!.timeseries.length, 2);
assert.strictEqual(metric!.timeseries.length, 2);
assert.deepStrictEqual(metric!.timeseries, [
{
labelValues: LABEL_VALUES_200,
Expand Down Expand Up @@ -136,7 +136,7 @@ describe('CUMULATIVE', () => {
point.inc();
const metric = instance.getMetric();
assert.deepStrictEqual(metric!.descriptor, expectedMetricDescriptor);
assert.equal(metric!.timeseries.length, 1);
assert.strictEqual(metric!.timeseries.length, 1);
assert.deepStrictEqual(metric!.timeseries, [{
labelValues: LABEL_VALUES_200,
points: [{value: 1, timestamp: mockedTime}],
Expand All @@ -149,7 +149,7 @@ describe('CUMULATIVE', () => {
point.inc(10);
let metric = instance.getMetric();
assert.deepStrictEqual(metric!.descriptor, expectedMetricDescriptor);
assert.equal(metric!.timeseries.length, 1);
assert.strictEqual(metric!.timeseries.length, 1);
assert.deepStrictEqual(metric!.timeseries, [{
labelValues: LABEL_VALUES_200,
points: [{value: 10, timestamp: mockedTime}],
Expand All @@ -160,7 +160,7 @@ describe('CUMULATIVE', () => {
point1.inc(30);
metric = instance.getMetric();
assert.deepStrictEqual(metric!.descriptor, expectedMetricDescriptor);
assert.equal(metric!.timeseries.length, 1);
assert.strictEqual(metric!.timeseries.length, 1);
assert.deepStrictEqual(metric!.timeseries, [{
labelValues: LABEL_VALUES_200,
points: [{value: 40, timestamp: mockedTime}],
Expand All @@ -181,7 +181,7 @@ describe('CUMULATIVE', () => {

const metric = instance.getMetric();
assert.deepStrictEqual(metric!.descriptor, expectedMetricDescriptor);
assert.equal(metric!.timeseries.length, 1);
assert.strictEqual(metric!.timeseries.length, 1);
assert.deepStrictEqual(
metric!.timeseries, [{
labelValues: [UNSET_LABEL_VALUE],
Expand All @@ -202,7 +202,7 @@ describe('CUMULATIVE', () => {
instance.getOrCreateTimeSeries([{value: '400'}, {value: '200'}]);
point1.inc(400);
const metric = instance.getMetric();
assert.equal(metric!.timeseries.length, 1);
assert.strictEqual(metric!.timeseries.length, 1);
});

it('should add constant labels', () => {
Expand All @@ -214,8 +214,8 @@ describe('CUMULATIVE', () => {
instance.getOrCreateTimeSeries([{value: '200'}, {value: '400'}]);
point.inc(200);
const metric = instance.getMetric();
assert.equal(metric!.descriptor.type, 5);
assert.equal(metric!.timeseries.length, 1);
assert.strictEqual(metric!.descriptor.type, 5);
assert.strictEqual(metric!.timeseries.length, 1);
assert.deepStrictEqual(metric!.descriptor.labelKeys, [
{key: 'k1', description: 'desc'}, {key: 'k2', description: 'desc'},
{key: 'host', description: 'host'}
Expand All @@ -241,7 +241,7 @@ describe('CUMULATIVE', () => {
const metric = instance.getMetric();
assert.deepStrictEqual(metric!.descriptor.labelKeys.length, 3);
assert.deepStrictEqual(metric!.descriptor.type, 5);
assert.equal(metric!.timeseries.length, 1);
assert.strictEqual(metric!.timeseries.length, 1);
assert.deepStrictEqual(
metric!.timeseries, [{
labelValues:
Expand All @@ -256,7 +256,7 @@ describe('CUMULATIVE', () => {
point.inc(300);
let metric = instance.getMetric();
assert.deepStrictEqual(metric!.descriptor, expectedMetricDescriptor);
assert.equal(metric!.timeseries.length, 1);
assert.strictEqual(metric!.timeseries.length, 1);
assert.deepStrictEqual(metric!.timeseries, [{
labelValues: [UNSET_LABEL_VALUE],
points: [{value: 300, timestamp: mockedTime}],
Expand All @@ -267,7 +267,7 @@ describe('CUMULATIVE', () => {
point1.inc(400);
metric = instance.getMetric();
assert.deepStrictEqual(metric!.descriptor, expectedMetricDescriptor);
assert.equal(metric!.timeseries.length, 1);
assert.strictEqual(metric!.timeseries.length, 1);
assert.deepStrictEqual(metric!.timeseries, [{
labelValues: [UNSET_LABEL_VALUE],
points: [{value: 700, timestamp: mockedTime}],
Expand Down Expand Up @@ -296,7 +296,7 @@ describe('CUMULATIVE', () => {
point1.inc(10);
let metric = instance.getMetric();
assert.deepStrictEqual(metric!.descriptor, expectedMetricDescriptor);
assert.equal(metric!.timeseries.length, 2);
assert.strictEqual(metric!.timeseries.length, 2);
instance.clear();
metric = instance.getMetric();
assert.deepStrictEqual(metric, null);
Expand Down
20 changes: 10 additions & 10 deletions packages/opencensus-core/test/test-derived-cumulative.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ describe('DerivedCumulative', () => {
let metric = instance.getMetric();
assert.notEqual(metric, null);
assert.deepStrictEqual(metric!.descriptor, expectedMetricDescriptor);
assert.equal(metric!.timeseries.length, 1);
assert.strictEqual(metric!.timeseries.length, 1);
assert.deepStrictEqual(metric!.timeseries, [{
labelValues: LABEL_VALUES_200,
points: [{value: 2, timestamp: mockedTime}],
Expand All @@ -99,7 +99,7 @@ describe('DerivedCumulative', () => {

metric = instance.getMetric();
assert.deepStrictEqual(metric!.descriptor, expectedMetricDescriptor);
assert.equal(metric!.timeseries.length, 2);
assert.strictEqual(metric!.timeseries.length, 2);
assert.deepStrictEqual(metric!.timeseries, [
{
labelValues: LABEL_VALUES_200,
Expand All @@ -125,7 +125,7 @@ describe('DerivedCumulative', () => {
const metric = instance.getMetric();
assert.notEqual(metric, null);
assert.deepStrictEqual(metric!.descriptor, expectedMetricDescriptor);
assert.equal(metric!.timeseries.length, 1);
assert.strictEqual(metric!.timeseries.length, 1);
assert.deepStrictEqual(metric!.timeseries, [{
labelValues: LABEL_VALUES_200,
points: [{value: 45, timestamp: mockedTime}],
Expand All @@ -152,7 +152,7 @@ describe('DerivedCumulative', () => {
let metric = instance.getMetric();
assert.notEqual(metric, null);
assert.deepStrictEqual(metric!.descriptor, expectedMetricDescriptor);
assert.equal(metric!.timeseries.length, 1);
assert.strictEqual(metric!.timeseries.length, 1);
assert.deepStrictEqual(metric!.timeseries, [{
labelValues: LABEL_VALUES_200,
points: [{value: 1, timestamp: mockedTime}],
Expand All @@ -163,7 +163,7 @@ describe('DerivedCumulative', () => {
queue.addJob();
queue.addJob();
metric = instance.getMetric();
assert.equal(metric!.timeseries.length, 1);
assert.strictEqual(metric!.timeseries.length, 1);
assert.deepStrictEqual(
metric!.timeseries[0].points, [{value: 4, timestamp: mockedTime}]);
});
Expand All @@ -188,7 +188,7 @@ describe('DerivedCumulative', () => {
type: CUMULATIVE_DOUBLE,
labelKeys: LABEL_KEYS
});
assert.equal(metric!.timeseries.length, 1);
assert.strictEqual(metric!.timeseries.length, 1);
assert.deepStrictEqual(metric!.timeseries, [{
labelValues: LABEL_VALUES_200,
points: [{value: 0.7, timestamp: mockedTime}],
Expand All @@ -203,7 +203,7 @@ describe('DerivedCumulative', () => {
map.set('key1', 'value1');
let metric = instance.getMetric();
assert.deepStrictEqual(metric!.descriptor, expectedMetricDescriptor);
assert.equal(metric!.timeseries.length, 1);
assert.strictEqual(metric!.timeseries.length, 1);
assert.deepStrictEqual(metric!.timeseries, [{
labelValues: LABEL_VALUES_200,
points: [{value: 2, timestamp: mockedTime}],
Expand All @@ -212,7 +212,7 @@ describe('DerivedCumulative', () => {

map.clear();
metric = instance.getMetric();
assert.equal(metric!.timeseries.length, 1);
assert.strictEqual(metric!.timeseries.length, 1);
assert.deepStrictEqual(metric!.timeseries, [{
labelValues: LABEL_VALUES_200,
points: [{value: 2, timestamp: mockedTime}],
Expand All @@ -227,7 +227,7 @@ describe('DerivedCumulative', () => {
const metric = instance.getMetric();
assert.notEqual(metric, null);
assert.deepStrictEqual(metric!.descriptor, expectedMetricDescriptor);
assert.equal(metric!.timeseries.length, 1);
assert.strictEqual(metric!.timeseries.length, 1);
assert.deepStrictEqual(metric!.timeseries, [{
labelValues: LABEL_VALUES_200,
points: [{value: 1, timestamp: mockedTime}],
Expand Down Expand Up @@ -271,7 +271,7 @@ describe('DerivedCumulative', () => {
let metric = instance.getMetric();
assert.notEqual(metric, null);
assert.deepStrictEqual(metric!.descriptor, expectedMetricDescriptor);
assert.equal(metric!.timeseries.length, 2);
assert.strictEqual(metric!.timeseries.length, 2);
instance.clear();
metric = instance.getMetric();
assert.deepStrictEqual(metric, null);
Expand Down
18 changes: 9 additions & 9 deletions packages/opencensus-core/test/test-derived-gauge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe('DerivedGauge', () => {
let metric = instance.getMetric();
assert.notEqual(metric, null);
assert.deepStrictEqual(metric!.descriptor, expectedMetricDescriptor);
assert.equal(metric!.timeseries.length, 1);
assert.strictEqual(metric!.timeseries.length, 1);
assert.deepStrictEqual(
metric!.timeseries, [{
labelValues: LABEL_VALUES_200,
Expand All @@ -101,7 +101,7 @@ describe('DerivedGauge', () => {

metric = instance.getMetric();
assert.deepStrictEqual(metric!.descriptor, expectedMetricDescriptor);
assert.equal(metric!.timeseries.length, 2);
assert.strictEqual(metric!.timeseries.length, 2);
assert.deepStrictEqual(metric!.timeseries, [
{
labelValues: LABEL_VALUES_200,
Expand Down Expand Up @@ -132,7 +132,7 @@ describe('DerivedGauge', () => {
const metric = instance.getMetric();
assert.notEqual(metric, null);
assert.deepStrictEqual(metric!.descriptor, expectedMetricDescriptor);
assert.equal(metric!.timeseries.length, 1);
assert.strictEqual(metric!.timeseries.length, 1);
assert.deepStrictEqual(
metric!.timeseries, [{
labelValues: LABEL_VALUES_200,
Expand Down Expand Up @@ -163,7 +163,7 @@ describe('DerivedGauge', () => {
let metric = instance.getMetric();
assert.notEqual(metric, null);
assert.deepStrictEqual(metric!.descriptor, expectedMetricDescriptor);
assert.equal(metric!.timeseries.length, 1);
assert.strictEqual(metric!.timeseries.length, 1);
assert.deepStrictEqual(
metric!.timeseries, [{
labelValues: LABEL_VALUES_200,
Expand All @@ -178,7 +178,7 @@ describe('DerivedGauge', () => {
queue.addJob();
queue.addJob();
metric = instance.getMetric();
assert.equal(metric!.timeseries.length, 1);
assert.strictEqual(metric!.timeseries.length, 1);
assert.deepStrictEqual(
metric!.timeseries[0].points, [{
value: 4,
Expand Down Expand Up @@ -207,7 +207,7 @@ describe('DerivedGauge', () => {
type: GAUGE_DOUBLE,
labelKeys: LABEL_KEYS
});
assert.equal(metric!.timeseries.length, 1);
assert.strictEqual(metric!.timeseries.length, 1);
assert.deepStrictEqual(
metric!.timeseries, [{
labelValues: LABEL_VALUES_200,
Expand Down Expand Up @@ -239,7 +239,7 @@ describe('DerivedGauge', () => {
type: GAUGE_DOUBLE,
labelKeys: [...LABEL_KEYS, ...Array.from(CONSTANT_LABELS.keys())]
});
assert.equal(metric!.timeseries.length, 1);
assert.strictEqual(metric!.timeseries.length, 1);
assert.deepStrictEqual(
metric!.timeseries, [{
labelValues:
Expand All @@ -259,7 +259,7 @@ describe('DerivedGauge', () => {
const metric = instance.getMetric();
assert.notEqual(metric, null);
assert.deepStrictEqual(metric!.descriptor, expectedMetricDescriptor);
assert.equal(metric!.timeseries.length, 1);
assert.strictEqual(metric!.timeseries.length, 1);
assert.deepStrictEqual(
metric!.timeseries, [{
labelValues: LABEL_VALUES_200,
Expand Down Expand Up @@ -305,7 +305,7 @@ describe('DerivedGauge', () => {
let metric = instance.getMetric();
assert.notEqual(metric, null);
assert.deepStrictEqual(metric!.descriptor, expectedMetricDescriptor);
assert.equal(metric!.timeseries.length, 2);
assert.strictEqual(metric!.timeseries.length, 2);
instance.clear();
metric = instance.getMetric();
assert.deepStrictEqual(metric, null);
Expand Down
Loading

0 comments on commit 20e4cf0

Please sign in to comment.