Skip to content

Commit 28afe22

Browse files
committed
Incorporate missing bug fix and bump dependencies
1 parent f1784d1 commit 28afe22

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
count[ val ] += 1;
5555
if ( count[ val ] === max ) {
5656
vals.push( val );
57-
} else {
57+
} else if ( count[ val ] > max ) {
5858
max = count[ val ];
5959
vals = [ val ];
6060
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
},
3636
"dependencies": {},
3737
"devDependencies": {
38-
"chai": "1.x.x",
39-
"mocha": "1.x.x",
38+
"chai": "2.x.x",
39+
"mocha": "2.x.x",
4040
"coveralls": "^2.11.1",
4141
"istanbul": "^0.3.0"
4242
},

test/test.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
'use strict';
12

23
// MODULES //
34

@@ -17,7 +18,6 @@ var expect = chai.expect,
1718
// TESTS //
1819

1920
describe( 'compute-mode', function tests() {
20-
'use strict';
2121

2222
it( 'should export a function', function test() {
2323
expect( mode ).to.be.a( 'function' );
@@ -53,6 +53,9 @@ describe( 'compute-mode', function tests() {
5353

5454
data = [ 2, 4, 5, 3, 8, 4, 2 ];
5555
assert.deepEqual( mode( data ), [ 2, 4 ] );
56+
57+
data = [ 2, 2, 4 ];
58+
assert.deepEqual( mode( data ), [ 2 ] );
5659
});
5760

5861
});

0 commit comments

Comments
 (0)