summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Tests/builtins/Reflect/Reflect.isExtensible.js
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries/LibJS/Tests/builtins/Reflect/Reflect.isExtensible.js')
-rw-r--r--Libraries/LibJS/Tests/builtins/Reflect/Reflect.isExtensible.js41
1 files changed, 22 insertions, 19 deletions
diff --git a/Libraries/LibJS/Tests/builtins/Reflect/Reflect.isExtensible.js b/Libraries/LibJS/Tests/builtins/Reflect/Reflect.isExtensible.js
index a2b8d8c34f..39f31c001f 100644
--- a/Libraries/LibJS/Tests/builtins/Reflect/Reflect.isExtensible.js
+++ b/Libraries/LibJS/Tests/builtins/Reflect/Reflect.isExtensible.js
@@ -1,30 +1,33 @@
test("length is 1", () => {
- expect(Reflect.isExtensible).toHaveLength(1);
+ expect(Reflect.isExtensible).toHaveLength(1);
});
describe("errors", () => {
- test("target must be an object", () => {
- [null, undefined, "foo", 123, NaN, Infinity].forEach(value => {
- expect(() => {
- Reflect.isExtensible(value);
- }).toThrowWithMessage(TypeError, "First argument of Reflect.isExtensible() must be an object");
- });
+ test("target must be an object", () => {
+ [null, undefined, "foo", 123, NaN, Infinity].forEach(value => {
+ expect(() => {
+ Reflect.isExtensible(value);
+ }).toThrowWithMessage(
+ TypeError,
+ "First argument of Reflect.isExtensible() must be an object"
+ );
});
+ });
});
describe("normal behavior", () => {
- test("regular object is extensible", () => {
- expect(Reflect.isExtensible({})).toBeTrue();
- });
+ test("regular object is extensible", () => {
+ expect(Reflect.isExtensible({})).toBeTrue();
+ });
- test("global object is extensible", () => {
- expect(Reflect.isExtensible(globalThis)).toBeTrue();
- });
+ test("global object is extensible", () => {
+ expect(Reflect.isExtensible(globalThis)).toBeTrue();
+ });
- test("regular object is not extensible after preventExtensions()", () => {
- var o = {};
- expect(Reflect.isExtensible(o)).toBeTrue();
- Reflect.preventExtensions(o);
- expect(Reflect.isExtensible(o)).toBeFalse();
- });
+ test("regular object is not extensible after preventExtensions()", () => {
+ var o = {};
+ expect(Reflect.isExtensible(o)).toBeTrue();
+ Reflect.preventExtensions(o);
+ expect(Reflect.isExtensible(o)).toBeFalse();
+ });
});