Skip to content

Commit e0c4e4e

Browse files
author
Vitaly Puzrin
committed
assert.equal() -> assert.strictEqual()
1 parent 0375c5e commit e0c4e4e

12 files changed

Lines changed: 92 additions & 92 deletions

File tree

test/issues/0017.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ var readFileSync = require('fs').readFileSync;
99
test('Non-specific "!" tags should resolve to !!str', function () {
1010
var data = yaml.safeLoad(readFileSync(require('path').join(__dirname, '/0017.yml'), 'utf8'));
1111

12-
assert.equal(typeof data, 'string');
12+
assert.strictEqual(typeof data, 'string');
1313
});

test/issues/0019.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ test('Timestamp parsing is one month off', function () {
1010
var data = yaml.safeLoad(readFileSync(require('path').join(__dirname, '/0019.yml'), 'utf8'));
1111

1212
// JS month starts with 0 (0 => Jan, 1 => Feb, ...)
13-
assert.equal(data.xmas.getTime(), Date.UTC(2011, 11, 24));
13+
assert.strictEqual(data.xmas.getTime(), Date.UTC(2011, 11, 24));
1414
});

test/issues/0026.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ var readFileSync = require('fs').readFileSync;
99
test('should convert new line into white space', function () {
1010
var data = yaml.safeLoad(readFileSync(require('path').join(__dirname, '/0026.yml'), 'utf8'));
1111

12-
assert.equal(data.test, 'a b c\n');
12+
assert.strictEqual(data.test, 'a b c\n');
1313
});

test/issues/0046.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ test('Timestamps are incorrectly parsed in local time', function () {
1111
date1, date2;
1212

1313
date1 = data.date1; // date1: 2010-10-20T20:45:00Z
14-
assert.equal(date1.getUTCFullYear(), 2010, 'year');
15-
assert.equal(date1.getUTCMonth(), 9, 'month');
16-
assert.equal(date1.getUTCDate(), 20, 'date');
17-
assert.equal(date1.getUTCHours(), 20);
18-
assert.equal(date1.getUTCMinutes(), 45);
19-
assert.equal(date1.getUTCSeconds(), 0);
14+
assert.strictEqual(date1.getUTCFullYear(), 2010, 'year');
15+
assert.strictEqual(date1.getUTCMonth(), 9, 'month');
16+
assert.strictEqual(date1.getUTCDate(), 20, 'date');
17+
assert.strictEqual(date1.getUTCHours(), 20);
18+
assert.strictEqual(date1.getUTCMinutes(), 45);
19+
assert.strictEqual(date1.getUTCSeconds(), 0);
2020

2121
date2 = data.date2; // date2: 2010-10-20T20:45:00+0100
22-
assert.equal(date2.getUTCFullYear(), 2010, 'year');
23-
assert.equal(date2.getUTCMonth(), 9, 'month');
24-
assert.equal(date2.getUTCDate(), 20, 'date');
25-
assert.equal(date2.getUTCHours(), 19);
26-
assert.equal(date2.getUTCMinutes(), 45);
27-
assert.equal(date2.getUTCSeconds(), 0);
22+
assert.strictEqual(date2.getUTCFullYear(), 2010, 'year');
23+
assert.strictEqual(date2.getUTCMonth(), 9, 'month');
24+
assert.strictEqual(date2.getUTCDate(), 20, 'date');
25+
assert.strictEqual(date2.getUTCHours(), 19);
26+
assert.strictEqual(date2.getUTCMinutes(), 45);
27+
assert.strictEqual(date2.getUTCSeconds(), 0);
2828
});

test/issues/0054.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ test("Incorrect utf-8 handling on require('file.yaml')", function () {
2323
// make sure none of the strings were corrupted.
2424
//
2525
for (index = 0; index < 40; index += 1) {
26-
assert.equal(data[index], expected, ('Line ' + index + ' is corrupted'));
26+
assert.strictEqual(data[index], expected, ('Line ' + index + ' is corrupted'));
2727
}
2828
});

test/issues/0110.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ test('Circular and cross references', function () {
2020

2121
var obtained = yaml.load(yaml.dump(source));
2222

23-
assert.equal(obtained.crossObject, obtained.a);
24-
assert.equal(obtained.crossArray, obtained.b);
25-
assert.equal(obtained.c.circularObject, obtained);
26-
assert.equal(obtained.d[0], obtained.d);
27-
assert.equal(obtained.d[1], obtained);
23+
assert.strictEqual(obtained.crossObject, obtained.a);
24+
assert.strictEqual(obtained.crossArray, obtained.b);
25+
assert.strictEqual(obtained.c.circularObject, obtained);
26+
assert.strictEqual(obtained.d[0], obtained.d);
27+
assert.strictEqual(obtained.d[1], obtained);
2828
});

test/issues/0123.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ test('RegExps should be properly closed', function () {
1717
// Accept the old (slightly incorrect) V8, as well as the new V8 result
1818
// TODO: Remove when/if Node 0.12 and below is no longer supported.
1919
if (regexpStr === '/fo/g/g') {
20-
assert.equal(regexpStr, '/fo/g/g');
20+
assert.strictEqual(regexpStr, '/fo/g/g');
2121
} else {
22-
assert.equal(regexpStr, '/fo\\/g/g');
22+
assert.strictEqual(regexpStr, '/fo\\/g/g');
2323
}
2424
});

test/issues/0194.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ test('Don\'t throw on warning', function () {
1717

1818
yaml.safeLoad(src, { onWarning: function (e) { warnings.push(e); } });
1919

20-
assert.equal(warnings.length, 1);
20+
assert.strictEqual(warnings.length, 1);
2121
});

test/issues/0205.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ test('Duplicated objects within array', function () {
1111

1212
var obtained = yaml.load(yaml.dump(arrayWithRefs));
1313

14-
assert.equal(obtained[0].test, 'canary');
15-
assert.equal(obtained[0], obtained[1]);
14+
assert.strictEqual(obtained[0].test, 'canary');
15+
assert.strictEqual(obtained[0], obtained[1]);
1616
});
1717

1818
test('Duplicated arrays within array', function () {
@@ -21,7 +21,7 @@ test('Duplicated arrays within array', function () {
2121

2222
var obtained = yaml.load(yaml.dump(arrayWithRefs));
2323

24-
assert.equal(obtained[0][0], 0);
25-
assert.equal(obtained[0][1], 1);
26-
assert.equal(obtained[0], obtained[1]);
24+
assert.strictEqual(obtained[0][0], 0);
25+
assert.strictEqual(obtained[0][1], 1);
26+
assert.strictEqual(obtained[0], obtained[1]);
2727
});

test/issues/0217.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ test('Folding Javascript functions preserves content', function () {
2525
// Tests loading a function, then tests dumping and loading.
2626
function assertFunctionPreserved(functionString, inputs, expectedOutputs, name) {
2727
var f = yaml.load('!<tag:yaml.org,2002:js/function> "' + functionString + '"');
28-
assert.equal(typeof f, 'function', name + ' should be loaded as a function');
28+
assert.strictEqual(typeof f, 'function', name + ' should be loaded as a function');
2929

3030
assert.deepEqual(inputs.map(f), expectedOutputs,
3131
name + ' should be loaded correctly');

0 commit comments

Comments
 (0)