mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibJS: Add ArrayBuffer
This commit is contained in:
committed by
Andreas Kling
parent
cf9da66b3e
commit
32571dfa53
Notes:
sideshowbarker
2024-07-19 01:05:04 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/32571dfa538 Pull-request: https://github.com/SerenityOS/serenity/pull/4307
13
Libraries/LibJS/Tests/builtins/ArrayBuffer/ArrayBuffer.js
Normal file
13
Libraries/LibJS/Tests/builtins/ArrayBuffer/ArrayBuffer.js
Normal file
@@ -0,0 +1,13 @@
|
||||
test("basic functionality", () => {
|
||||
expect(ArrayBuffer).toHaveLength(1);
|
||||
expect(ArrayBuffer.name).toBe("ArrayBuffer");
|
||||
expect(ArrayBuffer.prototype.constructor).toBe(ArrayBuffer);
|
||||
expect(new ArrayBuffer()).toBeInstanceOf(ArrayBuffer);
|
||||
expect(typeof new ArrayBuffer()).toBe("object");
|
||||
});
|
||||
|
||||
test("ArrayBuffer constructor must be invoked with 'new'", () => {
|
||||
expect(() => {
|
||||
ArrayBuffer();
|
||||
}).toThrowWithMessage(TypeError, "ArrayBuffer constructor must be called with 'new'");
|
||||
});
|
||||
Reference in New Issue
Block a user