rename translateAnItem -> selectItem

This commit is contained in:
tmshv committed 2016-02-22 04:20:49 +03:00
1 parent 2cf5d0cc65
commit 62d710ea31
3 files changed
+8 -8

No files matched your search

+5 -5
View File
@@ -1,18 +1,18 @@
import should from 'should';
import {translateAnItem} from '../../src/utils/common';
import {selectItem} from '../../src/utils/common';
describe('utils', () => {
describe('common.js', () => {
describe('translateAnItem', () => {
describe('selectItem', () => {
let sample = [[1235, 'hello'], [2352, 'banana']];
it('should return a function', () => {
let fn = translateAnItem();
let fn = selectItem();
fn.should.be.type('function');
});
it('should accept a function as a first parameter and use it as byCondition', () => {
let fn = translateAnItem(
let fn = selectItem(
i => i[0] === 2352 && i[1] === 'banana' && i.length === 2,
i => i[1]
);
@@ -22,7 +22,7 @@ describe('utils', () => {
});
it('should accept a function as a second parameter and use it as mapping function', () => {
let fn = translateAnItem(
let fn = selectItem(
i => i[0] === 2352,
i => i[1]
);