mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
test: using const and strictEqual
PR-URL: https://github.com/nodejs/node/pull/9926 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 parent
6ed0e8b49c
commit
f6d15b033b
2 files changed
+14
-14
No files matched your search
@@ -15,7 +15,7 @@ process.stdout.write = process.stderr.write = function() {
|
||||
};
|
||||
|
||||
// make sure that the "Console" function exists
|
||||
assert.equal('function', typeof Console);
|
||||
assert.strictEqual('function', typeof Console);
|
||||
|
||||
// make sure that the Console constructor throws
|
||||
// when not given a writable stream instance
|
||||
@@ -35,7 +35,7 @@ out.write = err.write = function(d) {};
|
||||
var c = new Console(out, err);
|
||||
|
||||
out.write = err.write = function(d) {
|
||||
assert.equal(d, 'test\n');
|
||||
assert.strictEqual(d, 'test\n');
|
||||
called = true;
|
||||
};
|
||||
|
||||
@@ -48,7 +48,7 @@ c.error('test');
|
||||
assert(called);
|
||||
|
||||
out.write = function(d) {
|
||||
assert.equal('{ foo: 1 }\n', d);
|
||||
assert.strictEqual('{ foo: 1 }\n', d);
|
||||
called = true;
|
||||
};
|
||||
|
||||
@@ -60,10 +60,10 @@ assert(called);
|
||||
called = 0;
|
||||
out.write = function(d) {
|
||||
called++;
|
||||
assert.equal(d, called + ' ' + (called - 1) + ' [ 1, 2, 3 ]\n');
|
||||
assert.strictEqual(d, called + ' ' + (called - 1) + ' [ 1, 2, 3 ]\n');
|
||||
};
|
||||
[1, 2, 3].forEach(c.log);
|
||||
assert.equal(3, called);
|
||||
assert.strictEqual(3, called);
|
||||
|
||||
// Console() detects if it is called without `new` keyword
|
||||
assert.doesNotThrow(function() {
|
||||
|
||||
Reference in new issue
Block a user