Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb188f90

Browse files
committed
Add fp tests for iteratee shorthands.
1 parent7b93dc9 commitb188f90

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

‎test/test-fp.js‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,32 @@
526526

527527
/*--------------------------------------------------------------------------*/
528528

529+
QUnit.module('iteratee shorthands');
530+
531+
(function(){
532+
varobjects=[{'a':1,'b':2},{'a':3,'b':4}];
533+
534+
QUnit.test('should work with "_.matches" shorthands',function(assert){
535+
assert.expect(1);
536+
537+
assert.deepEqual(fp.filter({'a':3})(objects),[objects[1]]);
538+
});
539+
540+
QUnit.test('should work with "_.matchesProperty" shorthands',function(assert){
541+
assert.expect(1);
542+
543+
assert.deepEqual(fp.filter(['a',3])(objects),[objects[1]]);
544+
});
545+
546+
QUnit.test('should work with "_.property" shorthands',function(assert){
547+
assert.expect(1);
548+
549+
assert.deepEqual(fp.map('a')(objects),[1,3]);
550+
});
551+
}());
552+
553+
/*--------------------------------------------------------------------------*/
554+
529555
QUnit.module('mutation methods');
530556

531557
(function(){

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp