Skip to content

Commit

Permalink
[Tests] add test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Feb 2, 2024
1 parent 706bcbc commit 6e78327
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,22 @@ module.exports = function (flatMap, t) {

st.end();
});

t.test('test262: staging test from v8', function (st) {
var arr1 = [0, 1, 2, 3];
var f = function (e) {
arr1[4] = 42;
return e;
};
st.deepEqual(flatMap(arr1, f), [0, 1, 2, 3]);

var arr2 = [0, 1, 2, 3];
var g = function (e) {
arr2.length = 3;
return e;
};
st.deepEqual(flatMap(arr2, g), [0, 1, 2]);

st.end();
});
};

0 comments on commit 6e78327

Please sign in to comment.