Sha256: 008a1dc49357214f9d9538a879d75189c9e85674ab3eb1d71af6d2e0884dc8a3

Contents?: true

Size: 710 Bytes

Versions: 15

Compression:

Stored size: 710 Bytes

Contents

describe('_', function() {
  it('can process a single item through _.mapIfArray', function() {
    var item = {};
    var result = _.mapIfArray(item, function(item) {
      return item;
    });

    expect(result).toEqual(item);
  });

  it('can process an array through _.mapIfArray', function() {
    var items = [{name: 'mapMany1'}, {name: 'mapMany2'}];
    var result = _.mapIfArray(items, function(item) {
      return item.name;
    });

    expect(result).toEqual(['mapMany1', 'mapMany2']);
  });

  it('can strip null values from an object with _.compactObject', function() {
    var testObject = {a: 1, b: null, c: 2, d: null};
    expect(_.compactObject(testObject)).toEqual({a: 1, c: 2});
  });
});

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
revelry_data-0.1.6 spec/dummy/spec/javascripts/utils_spec.js
revelry_data-0.0.15 spec/dummy/spec/javascripts/utils_spec.js
revelry_data-0.1.5 spec/dummy/spec/javascripts/utils_spec.js
revelry_data-0.1.4 spec/dummy/spec/javascripts/utils_spec.js
revelry_data-0.0.14 spec/dummy/spec/javascripts/utils_spec.js
revelry_data-0.0.8.1 spec/dummy/spec/javascripts/utils_spec.js
revelry_data-0.0.13 spec/dummy/spec/javascripts/utils_spec.js
revelry_data-0.1.3 spec/dummy/spec/javascripts/utils_spec.js
revelry_data-0.0.12 spec/dummy/spec/javascripts/utils_spec.js
revelry_data-0.1.2 spec/dummy/spec/javascripts/utils_spec.js
revelry_data-0.1.1 spec/dummy/spec/javascripts/utils_spec.js
revelry_data-0.0.10 spec/dummy/spec/javascripts/utils_spec.js
revelry_data-0.1.0 spec/dummy/spec/javascripts/utils_spec.js
revelry_data-0.0.8 spec/dummy/spec/javascripts/utils_spec.js
revelry_data-0.0.7 spec/dummy/spec/javascripts/utils_spec.js