-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/challenge 2 #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
yasirelbouazzati
wants to merge
20
commits into
main
Choose a base branch
from
feat/challenge-2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
4c69465
first activity complete and create new file .yaml
yasirelbouazzati d943b3c
first activity complete and create new file .yaml
yasirelbouazzati d823605
activity0 complete
yasirelbouazzati 2e286e8
add the workflos
yasirelbouazzati d6bcb75
add the workflos
yasirelbouazzati d2887d6
add the workflos
yasirelbouazzati 8063e15
add the workflos
yasirelbouazzati 4754694
Delete package.json
yasirelbouazzati 7e0f07e
Delete package-lock.json
yasirelbouazzati 1afc354
Add files via upload
yasirelbouazzati e1e3ed7
Update package-lock.json
yasirelbouazzati 79247df
Delete package.json
yasirelbouazzati 19cda37
Delete package-lock.json
yasirelbouazzati 9d431eb
Add files via upload
yasirelbouazzati a6e56f1
1
yasirelbouazzati 6a3aa55
exercice 1 complete
yasirelbouazzati 8b67576
Delete node_modules directory
yasirelbouazzati 4a954d3
hide the node_modules
yasirelbouazzati 9f77aae
activity 02-filter and 03-reduce is almost complete
yasirelbouazzati b82d8b4
activity 03-reduce is almost complete
yasirelbouazzati File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| nom_modules | ||
| node_modules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| node_modules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import feedMonkeys from "./feedMonkeys.js"; | ||
| describe("Given feedMonkeys", () => { | ||
| test("when 🍌 is provided as argument Then exècted array should be returned ", () => { | ||
| const fruit = "🍌"; | ||
| const EXPECTED_RESULT = ["🐒 🍌", "🦍 🍌", "🦧 🍌"]; | ||
|
|
||
| const Monkeys = feedMonkeys(fruit); | ||
|
|
||
| expect(Monkeys).toBeDefined(); | ||
| expect(Monkeys).toEqual(EXPECTED_RESULT); | ||
| }); | ||
| test("when 🍎 is provided as argument Then exècted array should be returned ", () => { | ||
| const fruit = "🍎"; | ||
| const EXPECTED_RESULT = ["🐒 🍎", "🦍 🍎", "🦧 🍎"]; | ||
|
|
||
| const Monkeys = feedMonkeys(fruit); | ||
|
|
||
| expect(Monkeys).toBeDefined(); | ||
| expect(Monkeys).toEqual(EXPECTED_RESULT); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import getLongWords from "./getLongWords.js"; | ||
| describe("Given getLongWords", () => { | ||
| test("when [Java, C++, JavaScript, C#, TypeScript] is provided as argument Then exècted array should be returned ", () => { | ||
| const WORDS = ["Java", "C++", "JavaScript", "C#", "TypeScript"]; | ||
| const EXPECTED_RESULT = ["JavaScript", "TypeScript"]; | ||
|
|
||
| const newCollection = getLongWords(WORDS); | ||
|
|
||
| expect(newCollection).toBeDefined(); | ||
| expect(newCollection).toEqual(EXPECTED_RESULT); | ||
| }); | ||
| test("when [John, George, Paul, Ringo] is provided as argument Then exècted array should be returned ", () => { | ||
| const WORDS = ["John", "George", "Paul", "Ringo"]; | ||
| const EXPECTED_RESULT = ["George", "Ringo"]; | ||
|
|
||
| const newCollection = getLongWords(WORDS); | ||
|
|
||
| expect(newCollection).toBeDefined(); | ||
| expect(newCollection).toEqual(EXPECTED_RESULT); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import sumNumbersFromInitialValue from "./sumNumbersFromInitialValue.js"; | ||
| describe("Given sumNumbersFromInitialValue", () => { | ||
| test("when an array of numbers and an initialValue is given as an argument, the sum of the values in the array starting at the initialValue is returned ", () => { | ||
| const NUMBERS = [1, 2, 3, 4, 5]; | ||
| const initialValue = 0; | ||
| const EXPECTED_RESULT = 15; | ||
|
|
||
| const sum = sumNumbersFromInitialValue(NUMBERS, initialValue); | ||
|
|
||
| expect(sum).toBeDefined(); | ||
| expect(sum).toEqual(EXPECTED_RESULT); | ||
| }); | ||
| test("when an array of numbers and an initialValue is given as an argument, the sum of the values in the array starting at the initialValue is returned ", () => { | ||
| const NUMBERS = [1, 2, 3, 4, 5]; | ||
| const initialValue = 10; | ||
| const EXPECTED_RESULT = 25; | ||
|
|
||
| const sum = sumNumbersFromInitialValue(NUMBERS, initialValue); | ||
|
|
||
| expect(sum).toBeDefined(); | ||
| expect(sum).toEqual(EXPECTED_RESULT); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import capitalizeMates from "./capitalizeMates.js"; | ||
|
|
||
| describe("capitalizeMates function", () => { | ||
| test("capitalizes names in the array", () => { | ||
| const inputMates = ["john", "JACOB", "jinGleHeimer", "schmidt"]; | ||
| const expectedOutput = ["John", "Jacob", "Jingleheimer", "Schmidt"]; | ||
|
|
||
| const result = capitalizeMates(inputMates); | ||
|
|
||
| expect(result).toEqual(expectedOutput); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| import extendUsersSettings from "./extendUsersSettings"; | ||
|
|
||
| describe("extendUsersSettings function", () => { | ||
| test("extends users properties with id and isEnabled", () => { | ||
| const inputUsers = [ | ||
| { | ||
| email: "lindsay.ferguson@reqres.in", | ||
| firstName: "Lindsay", | ||
| lastName: "Lawson", | ||
| avatar: "https://reqres.in/img/faces/7-image.jpg", | ||
| }, | ||
| { | ||
| email: "michael.lawson@reqres.in", | ||
| firstName: "Michael", | ||
| lastName: "Ferguson", | ||
| avatar: "https://reqres.in/img/faces/8-image.jpg", | ||
| }, | ||
| { | ||
| email: "tobias.funke@reqres.in", | ||
| firstName: "Tobias", | ||
| lastName: "Funke", | ||
| avatar: "https://reqres.in/img/faces/9-image.jpg", | ||
| }, | ||
| ]; | ||
|
|
||
| const expectedOutput = [ | ||
| { | ||
| email: "lindsay.ferguson@reqres.in", | ||
| firstName: "Lindsay", | ||
| lastName: "Lawson", | ||
| avatar: "https://reqres.in/img/faces/7-image.jpg", | ||
| id: 0, | ||
| isEnabled: true, | ||
| }, | ||
| { | ||
| email: "michael.lawson@reqres.in", | ||
| firstName: "Michael", | ||
| lastName: "Ferguson", | ||
| avatar: "https://reqres.in/img/faces/8-image.jpg", | ||
| id: 1, | ||
| isEnabled: true, | ||
| }, | ||
| { | ||
| email: "tobias.funke@reqres.in", | ||
| firstName: "Tobias", | ||
| lastName: "Funke", | ||
| avatar: "https://reqres.in/img/faces/9-image.jpg", | ||
| id: 2, | ||
| isEnabled: true, | ||
| }, | ||
| ]; | ||
|
|
||
| const result = extendUsersSettings(inputUsers); | ||
|
|
||
| expect(result).toEqual(expectedOutput); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import extractVipsNames from "./extractVipsNames"; | ||
|
|
||
| describe("extractVipsNames function", () => { | ||
| test("returns an array of strings with vips names", () => { | ||
| const inputVIPS = [ | ||
| { name: "Foo", age: 80 }, | ||
| { name: "Bar", age: 2 }, | ||
| { name: "Fizz", age: 5 }, | ||
| { name: "Buzz", age: 16 }, | ||
| { name: "FizzBuzz", age: 100 }, | ||
| ]; | ||
|
|
||
| const expectedOutput = ["Foo", "Bar", "Fizz", "Buzz", "FizzBuzz"]; | ||
|
|
||
| const result = extractVipsNames(inputVIPS); | ||
|
|
||
| expect(result).toEqual(expectedOutput); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import feedMonkeys from "./feedMonkeys"; | ||
|
|
||
| describe("feedMonkeys function", () => { | ||
| test("returns an array with each monkey having one fruit (🍌)", () => { | ||
| const fruit = "🍌"; | ||
| const expectedOutput = ["🐒 🍌", "🦍 🍌", "🦧 🍌"]; | ||
|
|
||
| const result = feedMonkeys(fruit); | ||
|
|
||
| expect(result).toEqual(expectedOutput); | ||
| }); | ||
|
|
||
| test("returns an array with each monkey having one fruit (🍎)", () => { | ||
| const fruit = "🍎"; | ||
| const expectedOutput = ["🐒 🍎", "🦍 🍎", "🦧 🍎"]; | ||
|
|
||
| const result = feedMonkeys(fruit); | ||
|
|
||
| expect(result).toEqual(expectedOutput); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import transformSecondsToWords from "./transformSecondsToWords"; | ||
|
|
||
| describe("transformSecondsToWords function", () => { | ||
| test("transforms numbers to strings", () => { | ||
| const inputSeconds = [2, 5, 100]; | ||
| const expectedOutput = ["2", "5", "100"]; | ||
|
|
||
| const result = transformSecondsToWords(inputSeconds); | ||
|
|
||
| expect(result).toEqual(expectedOutput); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| import customersWhoBelongToMembership from "./customersWhoBelongToMembership.js"; | ||
| describe("Given customersWhoBelongToMembership", () => { | ||
| test("when an array of strings is given as an argument, then the exected array should be returned ", () => { | ||
| const CUSTOMERS = [ | ||
| { | ||
| name: "Foo", | ||
| member: true, | ||
| }, | ||
| { | ||
| name: "Bar", | ||
| member: false, | ||
| }, | ||
| { | ||
| name: "Fizz", | ||
| member: true, | ||
| }, | ||
| { | ||
| name: "Buzz", | ||
| member: false, | ||
| }, | ||
| { | ||
| name: "FizzBuzz", | ||
| member: true, | ||
| }, | ||
| ]; | ||
| const EXPECTED_RESULT = [ | ||
| { name: "Foo", member: true }, | ||
| { name: "Fizz", member: true }, | ||
| { name: "FizzBuzz", member: true }, | ||
| ]; | ||
|
|
||
| const menbers = customersWhoBelongToMembership(CUSTOMERS); | ||
|
|
||
| expect(menbers).toBeDefined(); | ||
| expect(menbers.length).toEqual(3); | ||
| expect(menbers).toEqual(EXPECTED_RESULT); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.