mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:47:35 +00:00
LibJS/Tests: Remove 'requires at least one argument' Array tests
These will be removed in favour of just taking the argument and 'risking' a ToObject on null or undefined - this is how the spec does it. While that will make the message slightly less specific, it'll bring the code closer to the spec and reduce complexity, which are both preferable at the moment. Doing this is a previous, separate commit is simply an attempt to make the object rewrite commit smaller.
This commit is contained in:
parent
777a93918f
commit
4e5362b7cb
9 changed files with 0 additions and 63 deletions
|
@ -3,12 +3,6 @@ test("length is 1", () => {
|
|||
});
|
||||
|
||||
describe("errors", () => {
|
||||
test("requires at least one argument", () => {
|
||||
expect(() => {
|
||||
[].every();
|
||||
}).toThrowWithMessage(TypeError, "Array.prototype.every() requires at least one argument");
|
||||
});
|
||||
|
||||
test("callback must be a function", () => {
|
||||
expect(() => {
|
||||
[].every(undefined);
|
||||
|
|
|
@ -3,12 +3,6 @@ test("length is 1", () => {
|
|||
});
|
||||
|
||||
describe("errors", () => {
|
||||
test("requires at least one argument", () => {
|
||||
expect(() => {
|
||||
[].filter();
|
||||
}).toThrowWithMessage(TypeError, "Array.prototype.filter() requires at least one argument");
|
||||
});
|
||||
|
||||
test("callback must be a function", () => {
|
||||
expect(() => {
|
||||
[].filter(undefined);
|
||||
|
|
|
@ -3,12 +3,6 @@ test("length is 1", () => {
|
|||
});
|
||||
|
||||
describe("errors", () => {
|
||||
test("requires at least one argument", () => {
|
||||
expect(() => {
|
||||
[].find();
|
||||
}).toThrowWithMessage(TypeError, "Array.prototype.find() requires at least one argument");
|
||||
});
|
||||
|
||||
test("callback must be a function", () => {
|
||||
expect(() => {
|
||||
[].find(undefined);
|
||||
|
|
|
@ -3,15 +3,6 @@ test("length is 1", () => {
|
|||
});
|
||||
|
||||
describe("errors", () => {
|
||||
test("requires at least one argument", () => {
|
||||
expect(() => {
|
||||
[].findIndex();
|
||||
}).toThrowWithMessage(
|
||||
TypeError,
|
||||
"Array.prototype.findIndex() requires at least one argument"
|
||||
);
|
||||
});
|
||||
|
||||
test("callback must be a function", () => {
|
||||
expect(() => {
|
||||
[].findIndex(undefined);
|
||||
|
|
|
@ -3,15 +3,6 @@ test("length is 1", () => {
|
|||
});
|
||||
|
||||
describe("errors", () => {
|
||||
test("requires at least one argument", () => {
|
||||
expect(() => {
|
||||
[].forEach();
|
||||
}).toThrowWithMessage(
|
||||
TypeError,
|
||||
"Array.prototype.forEach() requires at least one argument"
|
||||
);
|
||||
});
|
||||
|
||||
test("callback must be a function", () => {
|
||||
expect(() => {
|
||||
[].forEach(undefined);
|
||||
|
|
|
@ -3,12 +3,6 @@ test("length is 1", () => {
|
|||
});
|
||||
|
||||
describe("errors", () => {
|
||||
test("requires at least one argument", () => {
|
||||
expect(() => {
|
||||
[].map();
|
||||
}).toThrowWithMessage(TypeError, "Array.prototype.map() requires at least one argument");
|
||||
});
|
||||
|
||||
test("callback must be a function", () => {
|
||||
expect(() => {
|
||||
[].map(undefined);
|
||||
|
|
|
@ -3,12 +3,6 @@ test("length is 1", () => {
|
|||
});
|
||||
|
||||
describe("errors", () => {
|
||||
test("requires at least one argument", () => {
|
||||
expect(() => {
|
||||
[].reduce();
|
||||
}).toThrowWithMessage(TypeError, "Array.prototype.reduce() requires at least one argument");
|
||||
});
|
||||
|
||||
test("callback must be a function", () => {
|
||||
expect(() => {
|
||||
[].reduce(undefined);
|
||||
|
|
|
@ -3,15 +3,6 @@ test("length is 1", () => {
|
|||
});
|
||||
|
||||
describe("errors", () => {
|
||||
test("requires at least one argument", () => {
|
||||
expect(() => {
|
||||
[].reduceRight();
|
||||
}).toThrowWithMessage(
|
||||
TypeError,
|
||||
"Array.prototype.reduceRight() requires at least one argument"
|
||||
);
|
||||
});
|
||||
|
||||
test("callback must be a function", () => {
|
||||
expect(() => {
|
||||
[].reduceRight(undefined);
|
||||
|
|
|
@ -3,12 +3,6 @@ test("length is 1", () => {
|
|||
});
|
||||
|
||||
describe("errors", () => {
|
||||
test("requires at least one argument", () => {
|
||||
expect(() => {
|
||||
[].some();
|
||||
}).toThrowWithMessage(TypeError, "Array.prototype.some() requires at least one argument");
|
||||
});
|
||||
|
||||
test("callback must be a function", () => {
|
||||
expect(() => {
|
||||
[].some(undefined);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue