mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-01 16:02:53 +00:00
Libraries: Move to Userland/Libraries/
This commit is contained in:
parent
dc28c07fa5
commit
13d7c09125
Notes:
sideshowbarker
2024-07-18 23:53:55 +09:00
Author: https://github.com/awesomekling
Commit: 13d7c09125
1857 changed files with 266 additions and 274 deletions
|
@ -1,25 +0,0 @@
|
|||
describe("errors", () => {
|
||||
test("cannot spread number in array", () => {
|
||||
expect(() => {
|
||||
[...1];
|
||||
}).toThrowWithMessage(TypeError, "1 is not iterable");
|
||||
});
|
||||
|
||||
test("cannot spread object in array", () => {
|
||||
expect(() => {
|
||||
[...{}];
|
||||
}).toThrowWithMessage(TypeError, "[object Object] is not iterable");
|
||||
});
|
||||
});
|
||||
|
||||
test("basic functionality", () => {
|
||||
expect([1, ...[2, 3], 4]).toEqual([1, 2, 3, 4]);
|
||||
|
||||
let a = [2, 3];
|
||||
expect([1, ...a, 4]).toEqual([1, 2, 3, 4]);
|
||||
|
||||
let obj = { a: [2, 3] };
|
||||
expect([1, ...obj.a, 4]).toEqual([1, 2, 3, 4]);
|
||||
|
||||
expect([...[], ...[...[1, 2, 3]], 4]).toEqual([1, 2, 3, 4]);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue