Skip to content

Commit

Permalink
Use t.equal instead of t.ok and ===.
Browse files Browse the repository at this point in the history
Now I see that `t.equal` is based on `===`.
  • Loading branch information
flatheadmill authored and ralphtheninja committed Sep 4, 2017
1 parent 5fb7e9e commit c3b90c2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test.js
Expand Up @@ -72,15 +72,15 @@ test('test key/value serialization', function (t) {
var buffer = new Buffer(0)
var test = new Test('foobar')

t.equal(typeof test._serializeKey(1), 'string', '_serializeKey converts to string')
t.equal(test._serializeKey(1), '1', '_serializeKey converts to string')
t.ok(test._serializeKey(buffer) === buffer, '_serializeKey returns Buffer as is')

t.equal(typeof test._serializeValue(1), 'string', '_serializeValue converts to string')
t.equal(test._serializeValue(1), '1', '_serializeValue converts to string')
t.equal(test._serializeValue(null), '', '_serializeValue converts null to empty string')
t.ok(test._serializeValue(buffer) === buffer, '_serializeValue returns Buffer as is')

process.browser = true
t.equal(typeof test._serializeValue(1), 'number', '_serializeValue returns value as is when process.browser')
t.equal(test._serializeValue(1), 1, '_serializeValue returns value as is when process.browser')
delete process.browser

t.end()
Expand Down

0 comments on commit c3b90c2

Please sign in to comment.