Skip to content

Commit

Permalink
Applies ava-codemod
Browse files Browse the repository at this point in the history
  • Loading branch information
godu committed Apr 19, 2016
1 parent 0156d8e commit c781dec
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 30 deletions.
12 changes: 6 additions & 6 deletions src/test/etcd-driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test('should create etcd driver', function(t) {
});

return driver.list().then(function(node) {
t.same(node.nodes, []);
t.deepEqual(node.nodes, []);
});
});

Expand Down Expand Up @@ -53,7 +53,7 @@ test('should fetch folder content', function(t) {
return node.value;
});
}).then(function(nodes) {
t.same(nodes, [{
t.deepEqual(nodes, [{
foo: 'foo'
}]);
});
Expand All @@ -68,8 +68,8 @@ test('should watch set', function(t) {
driver.watch({
set: function(err, node) {
if (node.dir) return;
t.same(node.key, '/foo');
t.same(node.value, 'bar');
t.deepEqual(node.key, '/foo');
t.deepEqual(node.value, 'bar');
cb();
}
});
Expand All @@ -86,8 +86,8 @@ test('should watch delete', function(t) {
return Promise.fromCallback(function(cb) {
driver.watch({
delete: function(err, node) {
t.same(node.key, '/foo');
t.same(node.value);
t.deepEqual(node.key, '/foo');
t.deepEqual(node.value);
cb();
}
});
Expand Down
10 changes: 5 additions & 5 deletions src/test/fallback.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ test('should fetch from server', function(t) {
});

return squirrel.get('/foo').then(function(node) {
t.same(node.value, 'foo');
t.deepEqual(node.value, 'foo');
});
});
});
Expand All @@ -43,7 +43,7 @@ test('should read fallback', function(t) {
});

return squirrel.get('/foo').then(function(node) {
t.same(node.value, 'bar');
t.deepEqual(node.value, 'bar');
});
});
});
Expand Down Expand Up @@ -84,7 +84,7 @@ test('should restore fallback if etcd is unavailable', function(t) {
});

return squirrel.get('/foo').then(function(node) {
t.same(node.value, 'bar');
t.deepEqual(node.value, 'bar');
});
});
});
Expand All @@ -104,15 +104,15 @@ test('should resync on reconnect', function(t) {
});

return squirrel.get('/foo').then(function(node) {
t.same(node.value, 'bar');
t.deepEqual(node.value, 'bar');
}).then(function() {
return Promise.fromCallback(t.context.proxy.listen);
}).then(function() {
return retry(squirrel, '/foo', function(node) {
return node.value !== 'bar';
});
}).then(function(node) {
t.same(node.value, 'foo');
t.deepEqual(node.value, 'foo');
});
});
});
26 changes: 13 additions & 13 deletions src/test/indexes.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ test('should find by name', function(t) {

return Promise.all([
squirrel.getBy('name', 'foo').then(function(value) {
t.same(value.name, 'foo');
t.deepEqual(value.name, 'foo');
}),
squirrel.getBy('name', 'bar').then(function(value) {
t.same(value.name, 'bar');
t.deepEqual(value.name, 'bar');
}),
squirrel.getBy('name', 'baz').then(function(value) {
t.same(value, null);
t.deepEqual(value, null);
})
]);
});
Expand All @@ -40,13 +40,13 @@ test('should find by host', function(t) {

return Promise.all([
squirrel.getBy('host', 'foo.coorpacademy.com').then(function(value) {
t.same(value.host, 'foo.coorpacademy.com');
t.deepEqual(value.host, 'foo.coorpacademy.com');
}),
squirrel.getBy('host', 'bar.coorpacademy.com').then(function(value) {
t.same(value.host, 'bar.coorpacademy.com');
t.deepEqual(value.host, 'bar.coorpacademy.com');
}),
squirrel.getBy('host', 'baz.coorpacademy.com').then(function(value) {
t.same(value, null);
t.deepEqual(value, null);
})
]);
});
Expand All @@ -61,13 +61,13 @@ test('should find by meta.foo', function(t) {

return Promise.all([
squirrel.getBy('meta.foo', 'foo').then(function(value) {
t.same(value.meta.foo, 'foo');
t.deepEqual(value.meta.foo, 'foo');
}),
squirrel.getBy('meta.foo', 'bar').then(function(value) {
t.same(value.meta.foo, 'bar');
t.deepEqual(value.meta.foo, 'bar');
}),
squirrel.getBy('meta.foo', 'baz').then(function(value) {
t.same(value, null);
t.deepEqual(value, null);
})
]);
});
Expand All @@ -87,10 +87,10 @@ test('should get all names', function(t) {

return Promise.all([
squirrel.getAll('name').then(function(values) {
t.same(values, ['foo', 'bar']);
t.deepEqual(values, ['foo', 'bar']);
}),
emptySquirrel.getAll('name').then(function(values) {
t.same(values, []);
t.deepEqual(values, []);
})
]);
});
Expand All @@ -110,10 +110,10 @@ test('should get all meta.foo', function(t) {

return Promise.all([
squirrel.getAll('meta.foo').then(function(values) {
t.same(values, ['foo', 'bar']);
t.deepEqual(values, ['foo', 'bar']);
}),
emptySquirrel.getAll('meta.foo').then(function(values) {
t.same(values, []);
t.deepEqual(values, []);
})
]);
});
8 changes: 4 additions & 4 deletions src/test/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ test('should sync squirrel', function(t) {
};

return squirrel.getBy('name', brand.value.name).then(function(value) {
t.same(value, null);
t.deepEqual(value, null);
return driver.set(brand.key, brand.value);
}).then(function() {
return retry(squirrel, brand.key, function(node) {
Expand All @@ -37,7 +37,7 @@ test('should sync squirrel', function(t) {
}).then(function() {
return squirrel.getBy('name', brand.value.name);
}).then(function(value) {
t.same(value, brand.value);
t.deepEqual(value, brand.value);
return driver.del(brand.key);
}).then(function() {
return retry(squirrel, brand.key, function(node) {
Expand All @@ -46,7 +46,7 @@ test('should sync squirrel', function(t) {
}).then(function() {
return squirrel.getBy('name', brand.value.name);
}).then(function(value) {
t.same(value, null);
t.deepEqual(value, null);
});
});

Expand All @@ -64,7 +64,7 @@ test('should override fallback', function(t) {

return Promise.all([
overridedsquirrel.getStore().then(function(node) {
t.same(node.nodes, []);
t.deepEqual(node.nodes, []);
}),
squirrel.getStore().then(function(node) {
t.is(node.nodes.length, 2);
Expand Down
4 changes: 2 additions & 2 deletions src/test/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ test('should watch set file', function(t) {
}).then(function() {
return squirrel.getBy('name', 'foo');
}).then(function(node) {
t.same(node, {
t.deepEqual(node, {
name: 'foo'
});
});
Expand All @@ -58,7 +58,7 @@ test('should watch add directory', function(t) {
}).then(function() {
return squirrel.get('/foo');
}).then(function(node) {
t.same(node.nodes, []);
t.deepEqual(node.nodes, []);
});
});

Expand Down

0 comments on commit c781dec

Please sign in to comment.