este-library-oldschool
Version:
Library for github.com/steida/este.git
34 lines • 1.09 kB
JavaScript
// Generated by github.com/steida/coffee2closure 900.1.18
suite('este.array', function() {
suite('removeAllIf', function() {
test('should return true if item was removed', function() {
var array, removed;
array = [1];
removed = este.array.removeAllIf(array, function(item) {
return item === 1;
});
assert.isTrue(removed);
return assert.lengthOf(array, 0);
});
return test('should return false if item was not removed', function() {
var array, removed;
array = [1];
removed = este.array.removeAllIf(array, function(item) {
return item === 2;
});
assert.isFalse(removed);
return assert.lengthOf(array, 1);
});
});
return suite('removeUndefined', function() {
return test('should remove undefined values from array', function() {
var array;
array = [0, 1];
este.array.removeUndefined(array);
assert.deepEqual(array, [0, 1]);
array = [0, void 0];
este.array.removeUndefined(array);
return assert.deepEqual(array, [0]);
});
});
});