Skip to content

Commit

Permalink
Add tests for Array#splice when only the first argument is provided.
Browse files Browse the repository at this point in the history
  • Loading branch information
Xotic750 committed Jan 28, 2016
1 parent d669661 commit a916f6e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/spec/s-array.js
Original file line number Diff line number Diff line change
Expand Up @@ -1441,6 +1441,21 @@ describe('Array', function () {
expect(test).toEqual(test2);
});

it('should work without optional arguments 1', function () {
var array = [0, 1, 2];
expect(array.splice(0)).toEqual([]);
});

it('should work without optional arguments 2', function () {
var array = [0, 1, 2];
expect(array.splice(1)).toEqual([0]);
});

it('should work without optional arguments 3', function () {
var array = [0, 1, 2];
expect(array.splice(2)).toEqual([0, 1]);
});

it('should work with objects - adding 1', function () {
var obj = {};
Array.prototype.splice.call(obj, 0, 0, 1, 2, 3);
Expand Down

0 comments on commit a916f6e

Please sign in to comment.