diff options
author | Matthew Olsson <matthewcolsson@gmail.com> | 2020-07-05 09:27:00 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-06 23:40:35 +0200 |
commit | 6d58c48c2fbe2e3ce9b9cfe1dd75a5ccc594f961 (patch) | |
tree | a7249b908d2f04f2f5bfcc2fb0af8faa99ef6adc /Libraries/LibJS/Tests/builtins/Reflect/Reflect.has.js | |
parent | e53288824235370608df41354d60b702d71dbc53 (diff) | |
download | serenity-6d58c48c2fbe2e3ce9b9cfe1dd75a5ccc594f961.zip |
test-js: Use prettier and format all files
Diffstat (limited to 'Libraries/LibJS/Tests/builtins/Reflect/Reflect.has.js')
-rw-r--r-- | Libraries/LibJS/Tests/builtins/Reflect/Reflect.has.js | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/Libraries/LibJS/Tests/builtins/Reflect/Reflect.has.js b/Libraries/LibJS/Tests/builtins/Reflect/Reflect.has.js index f343daeafa..c374ac6f13 100644 --- a/Libraries/LibJS/Tests/builtins/Reflect/Reflect.has.js +++ b/Libraries/LibJS/Tests/builtins/Reflect/Reflect.has.js @@ -1,45 +1,45 @@ test("length is 2", () => { - expect(Reflect.has).toHaveLength(2); + expect(Reflect.has).toHaveLength(2); }); describe("errors", () => { - test("target must be an object", () => { - [null, undefined, "foo", 123, NaN, Infinity].forEach(value => { - expect(() => { - Reflect.has(value); - }).toThrowWithMessage(TypeError, "First argument of Reflect.has() must be an object"); - }); + test("target must be an object", () => { + [null, undefined, "foo", 123, NaN, Infinity].forEach(value => { + expect(() => { + Reflect.has(value); + }).toThrowWithMessage(TypeError, "First argument of Reflect.has() must be an object"); }); + }); }); describe("normal behavior", () => { - test("regular object has property", () => { - expect(Reflect.has({})).toBeFalse(); - expect(Reflect.has({ undefined })).toBeTrue(); - expect(Reflect.has({ 0: "1" }, "0")).toBeTrue(); - expect(Reflect.has({ foo: "bar" }, "foo")).toBeTrue(); - expect(Reflect.has({ bar: "baz" }, "foo")).toBeFalse(); - expect(Reflect.has({}, "toString")).toBeTrue(); - }); + test("regular object has property", () => { + expect(Reflect.has({})).toBeFalse(); + expect(Reflect.has({ undefined })).toBeTrue(); + expect(Reflect.has({ 0: "1" }, "0")).toBeTrue(); + expect(Reflect.has({ foo: "bar" }, "foo")).toBeTrue(); + expect(Reflect.has({ bar: "baz" }, "foo")).toBeFalse(); + expect(Reflect.has({}, "toString")).toBeTrue(); + }); - test("array has property", () => { - expect(Reflect.has([])).toBeFalse(); - expect(Reflect.has([], 0)).toBeFalse(); - expect(Reflect.has([1, 2, 3], "0")).toBeTrue(); - expect(Reflect.has([1, 2, 3], 0)).toBeTrue(); - expect(Reflect.has([1, 2, 3], 1)).toBeTrue(); - expect(Reflect.has([1, 2, 3], 2)).toBeTrue(); - expect(Reflect.has([1, 2, 3], 3)).toBeFalse(); - expect(Reflect.has([], "pop")).toBeTrue(); - }); + test("array has property", () => { + expect(Reflect.has([])).toBeFalse(); + expect(Reflect.has([], 0)).toBeFalse(); + expect(Reflect.has([1, 2, 3], "0")).toBeTrue(); + expect(Reflect.has([1, 2, 3], 0)).toBeTrue(); + expect(Reflect.has([1, 2, 3], 1)).toBeTrue(); + expect(Reflect.has([1, 2, 3], 2)).toBeTrue(); + expect(Reflect.has([1, 2, 3], 3)).toBeFalse(); + expect(Reflect.has([], "pop")).toBeTrue(); + }); - test("string object has property", () => { - expect(Reflect.has(new String())).toBeFalse(); - expect(Reflect.has(new String("foo"), "0")).toBeTrue(); - expect(Reflect.has(new String("foo"), 0)).toBeTrue(); - expect(Reflect.has(new String("foo"), 1)).toBeTrue(); - expect(Reflect.has(new String("foo"), 2)).toBeTrue(); - expect(Reflect.has(new String("foo"), 3)).toBeFalse(); - expect(Reflect.has(new String("foo"), "charAt")).toBeTrue(); - }); + test("string object has property", () => { + expect(Reflect.has(new String())).toBeFalse(); + expect(Reflect.has(new String("foo"), "0")).toBeTrue(); + expect(Reflect.has(new String("foo"), 0)).toBeTrue(); + expect(Reflect.has(new String("foo"), 1)).toBeTrue(); + expect(Reflect.has(new String("foo"), 2)).toBeTrue(); + expect(Reflect.has(new String("foo"), 3)).toBeFalse(); + expect(Reflect.has(new String("foo"), "charAt")).toBeTrue(); + }); }); |