summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Tests/builtins
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries/LibJS/Tests/builtins')
-rw-r--r--Libraries/LibJS/Tests/builtins/TypedArray/TypedArray.prototype.length.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/Libraries/LibJS/Tests/builtins/TypedArray/TypedArray.prototype.length.js b/Libraries/LibJS/Tests/builtins/TypedArray/TypedArray.prototype.length.js
new file mode 100644
index 0000000000..bbe85a2bf1
--- /dev/null
+++ b/Libraries/LibJS/Tests/builtins/TypedArray/TypedArray.prototype.length.js
@@ -0,0 +1,10 @@
+// Update when more typed arrays get added
+const TYPED_ARRAYS = [Uint8Array, Uint16Array, Uint32Array, Int8Array, Int16Array, Int32Array];
+
+test("basic functionality", () => {
+ TYPED_ARRAYS.forEach(T => {
+ const typedArray = new T(42);
+ expect(Object.hasOwnProperty(typedArray, "length")).toBeFalse();
+ expect(typedArray.length).toBe(42);
+ });
+});