Skip to content

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
Also fix a bug in test helpers in which `util` was not required.
  • Loading branch information
remarkablemark committed Aug 23, 2016
1 parent 9497215 commit d62961a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion lib/html-to-dom-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ function formatDOM(nodes, parentNode) {
};

// set the next node for the previous node (if applicable)
if (prevNode = result[i - 1]) {
prevNode = result[i - 1];
if (prevNode) {
prevNode.next = nodeObj;
}

Expand Down
4 changes: 2 additions & 2 deletions test/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ describe('test helper', function() {
var obj1;
var obj2;

var obj1 = { foo: 'bar', baz: ['qux', 42, null], obj: {} };
obj1 = { foo: 'bar', baz: ['qux', 42, null], obj: {} };
obj1.ref = obj1.obj;
var obj2 = { obj: {}, baz: ['qux', 42, null], foo: 'bar' };
obj2 = { obj: {}, baz: ['qux', 42, null], foo: 'bar' };
obj2.ref = obj2.obj;
deepEqualCircular(obj1, obj2);
});
Expand Down
1 change: 1 addition & 0 deletions test/helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Module dependencies.
*/
var assert = require('assert');
var util = require('util');

/**
* Test for deep equality between objects that have circular references.
Expand Down
8 changes: 4 additions & 4 deletions test/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('utilties', function() {
[undefined, null, 1337, {}, []].forEach(function(parameter) {
assert.throws(function() { camelCase(parameter); });
});
})
});
});

describe('`invertObject` helper', function() {
Expand All @@ -40,7 +40,7 @@ describe('utilties', function() {
[undefined, null, 'foo', 1337].forEach(function(parameter) {
assert.throws(function() { invertObject(parameter); });
});
})
});

it('swaps key with value for object', function() {
assert.deepEqual(
Expand All @@ -67,7 +67,7 @@ describe('utilties', function() {

it('uses override if valid', function() {
assert.deepEqual(
invertObject({ foo: 'bar', baz: 'qux' }, function(key, value) {
invertObject({ foo: 'bar', baz: 'qux' }, function(key) {
if (key === 'foo') {
return ['key', 'value'];
}
Expand All @@ -78,7 +78,7 @@ describe('utilties', function() {

it('does not use override if invalid', function() {
assert.deepEqual(
invertObject({ foo: 'bar', baz: 'qux' }, function(key, value) {
invertObject({ foo: 'bar', baz: 'qux' }, function(key) {
if (key === 'foo') {
return ['key'];
} else if (key === 'baz') {
Expand Down

0 comments on commit d62961a

Please sign in to comment.