Skip to content

Commit 4f746bb

Browse files
feat: add find method to array/fixed-endian-factory
1 parent abe8ab4 commit 4f746bb

File tree

1 file changed

+4
-3
lines changed
  • lib/node_modules/@stdlib/array/fixed-endian-factory/test

1 file changed

+4
-3
lines changed

lib/node_modules/@stdlib/array/fixed-endian-factory/test/test.find.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ tape( 'the method returns the first element that satisfies the predicate', funct
141141
arr = new ctor( 'little-endian', [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );
142142
result = arr.find( predicate );
143143

144-
t.strictEqual( result, 3.0, 'returns expected value' );
144+
t.strictEqual( result, 1.0, 'returns expected value' );
145145
t.end();
146146

147147
function predicate( v ) {
@@ -155,7 +155,7 @@ tape( 'the method returns `undefined` if no elements satisfy the predicate', fun
155155
var arr;
156156

157157
ctor = factory( 'float64' );
158-
arr = new ctor( 'little-endian', [ 1.0, 2.0, -3.0, 4.0, 5.0 ] );
158+
arr = new ctor( 'little-endian', [ -1.0, -2.0, -3.0, -4.0, -5.0 ] );
159159
result = arr.find( predicate );
160160

161161
t.strictEqual( result, undefined, 'returns expected value' );
@@ -179,7 +179,8 @@ tape( 'the method supports providing an execution context', function test( t ) {
179179
};
180180
result = arr.find( predicate, ctx );
181181

182-
t.strictEqual( result, 4.0, 'returns expected value' );
182+
t.strictEqual( result, 1.0, 'returns expected value' );
183+
t.strictEqual( ctx.count, 1.0, 'returns expected value' );
183184
t.end();
184185

185186
function predicate( v ) {

0 commit comments

Comments
 (0)