Skip to content

Commit 9285ca4

Browse files
committed
New/ Contains Excercise
1 parent 2ece854 commit 9285ca4

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

Sprint-2/implement/contains.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,3 @@ function contains(someObject, propertyName) {
99

1010
module.exports = contains;
1111

12-
// Implement a function called contains that checks an object contains a
13-
// particular property

Sprint-2/implement/contains.test.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,21 @@ as the object doesn't contains a key of 'c'
2020
// Given an empty object
2121
// When passed to contains
2222
// Then it should return false
23-
test("contains on empty object returns false",() =>{
24-
const inputEmpty = [];
25-
const result = contains(inputEmpty);
26-
expect(result).toEqual(false);
23+
test("contains on empty object returns false", () => {
24+
const inputEmpty = [];
25+
const result = contains(inputEmpty);
26+
expect(result).toEqual(false);
2727
});
2828

2929
// Given an object with properties
3030
// When passed to contains with an existing property name
3131
// Then it should return true
3232
test("Given an object with properties when pass to contains it returns true", () => {
33-
const myObject = {
34-
name: "Alice",
35-
age: 30,
36-
city: "London",
37-
};
33+
const myObject = {
34+
name: "Alice",
35+
age: 30,
36+
city: "London",
37+
};
3838
const result = contains(myObject, "name");
3939
expect(result).toEqual(true);
4040
});
@@ -43,9 +43,9 @@ const myObject = {
4343
// When passed to contains with a non-existent property name
4444
// Then it should return false
4545
test("give a object with proprieties when pass contains with non-exist proprity name it should return false", () => {
46-
const inputProprieties2 = ["f", "g", "h"];
47-
const result = contains(inputProprieties2);
48-
expect (result).toEqual(false);
46+
const inputProprieties2 = ["f", "g", "h"];
47+
const result = contains(inputProprieties2);
48+
expect(result).toEqual(false);
4949
});
5050

5151
// Given invalid parameters like an array

0 commit comments

Comments
 (0)