mirror of
https://github.com/RGBCube/serenity
synced 2025-05-23 18:15:06 +00:00
LibJS: Indent tests with 4 spaces instead of 2
This commit is contained in:
parent
15de2eda2b
commit
1ef573eb30
261 changed files with 8536 additions and 8497 deletions
|
@ -1,32 +1,32 @@
|
|||
test("in operator with objects", () => {
|
||||
const o = { foo: "bar", bar: undefined };
|
||||
expect("" in o).toBeFalse();
|
||||
expect("foo" in o).toBeTrue();
|
||||
expect("bar" in o).toBeTrue();
|
||||
expect("baz" in o).toBeFalse();
|
||||
expect("toString" in o).toBeTrue();
|
||||
const o = { foo: "bar", bar: undefined };
|
||||
expect("" in o).toBeFalse();
|
||||
expect("foo" in o).toBeTrue();
|
||||
expect("bar" in o).toBeTrue();
|
||||
expect("baz" in o).toBeFalse();
|
||||
expect("toString" in o).toBeTrue();
|
||||
});
|
||||
|
||||
test("in operator with arrays", () => {
|
||||
const a = ["hello", "friends"];
|
||||
expect(0 in a).toBeTrue();
|
||||
expect(1 in a).toBeTrue();
|
||||
expect(2 in a).toBeFalse();
|
||||
expect("0" in a).toBeTrue();
|
||||
expect("hello" in a).toBeFalse();
|
||||
expect("friends" in a).toBeFalse();
|
||||
expect("length" in a).toBeTrue();
|
||||
const a = ["hello", "friends"];
|
||||
expect(0 in a).toBeTrue();
|
||||
expect(1 in a).toBeTrue();
|
||||
expect(2 in a).toBeFalse();
|
||||
expect("0" in a).toBeTrue();
|
||||
expect("hello" in a).toBeFalse();
|
||||
expect("friends" in a).toBeFalse();
|
||||
expect("length" in a).toBeTrue();
|
||||
});
|
||||
|
||||
test("in operator with string object", () => {
|
||||
const s = new String("foo");
|
||||
expect("length" in s).toBeTrue();
|
||||
const s = new String("foo");
|
||||
expect("length" in s).toBeTrue();
|
||||
});
|
||||
|
||||
test("error when used with primitives", () => {
|
||||
["foo", 123, null, undefined].forEach(value => {
|
||||
expect(() => {
|
||||
"prop" in value;
|
||||
}).toThrowWithMessage(TypeError, "'in' operator must be used on an object");
|
||||
});
|
||||
["foo", 123, null, undefined].forEach(value => {
|
||||
expect(() => {
|
||||
"prop" in value;
|
||||
}).toThrowWithMessage(TypeError, "'in' operator must be used on an object");
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue