refactor(automacao): template desafio 2 automatizado

This commit is contained in:
Caroline Moran 2022-10-27 11:07:13 -04:00
commit 8baf158b6a
35 changed files with 6197 additions and 0 deletions

8
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,8 @@
{
"files.exclude": {
"**/node_modules": true,
".gitignore": true,
"jest.config.js": true,
"package-lock.json": true,
}
}

4
01-greeting/index.js Normal file
View File

@ -0,0 +1,4 @@
export function greet(name) {
// implementar logica aqui
return "";
}

14
01-greeting/intex.test.js Normal file
View File

@ -0,0 +1,14 @@
import { greet } from "./."
describe("greet1", () => {
it("Dever retornar \"Hello Maria\" quando passamos a palavra \"Maria\"", () => {
expect(greet("Maria")).toBe("Hello Maria")
})
it("Dever retornar \"Hello Alvin\" quando passamos a palavra \"Alvin\"", () => {
expect(greet("Alvin")).toBe("Hello Alvin")
})
it("Dever retornar \"Hello Pedro Lucas\" quando passamos a palavra \"Pedro Lucas\"", () => {
expect(greet("Pedro Lucas")).toBe("Hello Pedro Lucas")
})
})

12
01-greeting/readme.md Normal file
View File

@ -0,0 +1,12 @@
# Desafio 01: Greeting
Faça um algoritmo que retorne uma string composta pela palavra "Hello" + texto que foi passado como argumento.
## Exemplo
```js
greeting('John') // "Hello John"
greeting('Carol Santos') // "Hello Carol Santos"
```

3
02-triangleArea/index.js Normal file
View File

@ -0,0 +1,3 @@
export function triangleArea(base, height) {
// your code here
}

View File

@ -0,0 +1,14 @@
import { triangleArea } from './index.js';
describe('triangleArea', () => {
it('Dever retornar 7.5 quando passamos os valores 3 e 5', () => {
expect(triangleArea(3, 5)).toBe(7.5)
})
it('Dever retornar 12.5 quando passamos os valores 5 e 5', () => {
expect(triangleArea(5, 5)).toBe(12.5)
})
it('Dever retornar 5 quando passamos os valores 2 e 5', () => {
expect(triangleArea(2, 5)).toBe(5)
})
})

11
02-triangleArea/readme.md Normal file
View File

@ -0,0 +1,11 @@
# Desafio 02: Área do triângulo
Faça um algoritmo que retorne a área de um triângulo.
## Exemplo
```js
triangleArea(10, 15) // 75
triangleArea(7, 9) // 31.5
triangleArea(9.25, 13.1) // 60.59
```

4
03-maxValue/index.js Normal file
View File

@ -0,0 +1,4 @@
export function maxValue(values) {
// implementar logica aqui
}

27
03-maxValue/index.test.js Normal file
View File

@ -0,0 +1,27 @@
import { maxValue } from "."
describe('maxValue', () => {
it('Dever retornar 12 quando passamos os valores [4, 6, 12, 5]', () => {
expect(maxValue([4, 6, 12, 5])).toBe(12)
})
it('Dever retornar 2311 quando passamos os valores [9, 234, 312, 999, 21, 2311]', () => {
expect(maxValue([9, 234, 312, 999, 21, 2311])).toBe(2311)
})
it('Dever retornar 23423 quando passamos os valores [533, 234, 23423, 32, 432]', () => {
expect(maxValue([533, 234, 23423, 32, 432])).toBe(23423)
})
it('Dever retornar 5 quando passamos os valores [5, 4, 3, 2, 1]', () => {
expect(maxValue([5, 4, 3, 2, 1])).toBe(5)
})
it('Dever retornar -1 quando passamos os valores [-1, -5, -10, -45]', () => {
expect(maxValue([-1, -5, -10, -45])).toBe(-1)
})
it('Dever retornar 0 quando passamos um array vazio []', () => {
expect(maxValue([])).toBe(0)
})
})

13
03-maxValue/readme.md Normal file
View File

@ -0,0 +1,13 @@
# Desafio 03: Valor máximo
Faça um algoritmo que retorne o maior valor de um array de números.
## Exemplo
```js
maxValue([10, 40, 30, 20, 50]) // 50
maxValue([10]) // 10
maxValue([30, 2, 1, -8]) // 30
maxValue([1, 2, 3, 4, 5, 10, 6, 7, 8, 9, ]) // 10
```

4
04-fibonacci/index.js Normal file
View File

@ -0,0 +1,4 @@
export function fibonacci(value) {
// implementar logica aqui
}

View File

@ -0,0 +1,39 @@
import { fibonacci } from "."
describe('fibonacci', () => {
it('Dever retornar 0 quando passamos o valor 0', () => {
expect(fibonacci(0)).toBe(0)
})
it('Dever retornar 1 quando passamos o valor 1', () => {
expect(fibonacci(1)).toBe(1)
})
it('Dever retornar 1 quando passamos o valor 2', () => {
expect(fibonacci(2)).toBe(1)
})
it('Dever retornar 2 quando passamos o valor 3', () => {
expect(fibonacci(3)).toBe(2)
})
it('Dever retornar 3 quando passamos o valor 4', () => {
expect(fibonacci(4)).toBe(3)
})
it('Dever retornar 5 quando passamos o valor 5', () => {
expect(fibonacci(5)).toBe(5)
})
it('deve retonar 8 quando passamos o valor 6', () => {
expect(fibonacci(6)).toBe(8)
})
it('Dever retornar 9227465 quando passamos o valor 35', () => {
expect(fibonacci(35)).toBe(9227465)
})
it('Dever retornar 1836311903 quando passamos o valor 46', () => {
expect(fibonacci(46)).toBe(1836311903)
})
})

18
04-fibonacci/readme.md Normal file
View File

@ -0,0 +1,18 @@
# Desafio 04: Fibonacci
Faça um algoritmo que resolva a função de Fibonacci
Fibonacci: https://pt.wikipedia.org/wiki/Sequ%C3%AAncia_de_Fibonacci
## Exemplo
```js
fibonacci(0) // 0
fibonacci(1) // 1
fibonacci(2) // 1
fibonacci(3) // 2
fibonacci(4) // 3
fibonacci(5) // 5
fibonacci(6) // 8
fibonacci(7) // 13
```

4
05-isPrime/index.js Normal file
View File

@ -0,0 +1,4 @@
export function isPrime(value) {
// implementar logica aqui
}

79
05-isPrime/index.test.js Normal file
View File

@ -0,0 +1,79 @@
import { isPrime } from ".";
describe("isPrime", () => {
it("Dever retornar true quando passamos o valor 2", () => {
expect(isPrime(2)).toBe(true);
});
it("Dever retornar true quando passamos o valor 3", () => {
expect(isPrime(3)).toBe(true);
});
it("Dever retornar true quando passamos o valor 5", () => {
expect(isPrime(5)).toBe(true);
});
it("Dever retornar true quando passamos o valor 7", () => {
expect(isPrime(7)).toBe(true);
});
it("Deve retornar false quando passamos o valor 9", () => {
expect(isPrime(9)).toBe(false);
})
it("Dever retornar true quando passamos o valor 11", () => {
expect(isPrime(11)).toBe(true);
});
it("Dever retornar true quando passamos o valor 13", () => {
expect(isPrime(13)).toBe(true);
});
it("Deve retornar false quando passamos o valor 15", () => {
expect(isPrime(15)).toBe(false);
})
it("Dever retornar true quando passamos o valor 17", () => {
expect(isPrime(17)).toBe(true);
});
it("Dever retornar true quando passamos o valor 19", () => {
expect(isPrime(19)).toBe(true);
});
it("Dever retornar true quando passamos o valor 23", () => {
expect(isPrime(23)).toBe(true);
});
it("Dever retornar true quando passamos o valor 29", () => {
expect(isPrime(29)).toBe(true);
});
it("Dever retornar true quando passamos o valor 31", () => {
expect(isPrime(31)).toBe(true);
});
it("Dever retornar true quando passamos o valor 37", () => {
expect(isPrime(37)).toBe(true);
});
it("Dever retornar true quando passamos o valor 41", () => {
expect(isPrime(41)).toBe(true);
});
it("Dever retornar true quando passamos o valor 43", () => {
expect(isPrime(43)).toBe(true);
});
it("Dever retornar true quando passamos o valor 47", () => {
expect(isPrime(47)).toBe(true);
});
it("Dever retornar true quando passamos o valor 53", () => {
expect(isPrime(53)).toBe(true);
});
it("Dever retornar true quando passamos o valor 59", () => {
expect(isPrime(59)).toBe(true);
});
})

12
05-isPrime/readme.md Normal file
View File

@ -0,0 +1,12 @@
# Desafio 05: É primo?
Faça um algoritmo que retorne se o numero passado é primo ou não
## Exemplo
```js
isPrime(7) // true
isPrime(10) // false
isPrime(11) // true
```

4
06-sum/index.js Normal file
View File

@ -0,0 +1,4 @@
export function sum(values) {
// implementar logica aqui
}

49
06-sum/index.test.js Normal file
View File

@ -0,0 +1,49 @@
import { sum } from ".";
describe("sum", () => {
it("Dever retornar 0 quando passamos o array vazio", () => {
expect(sum([])).toBe(0);
});
it("Dever retornar 1 quando passamos o array [1]", () => {
expect(sum([1])).toBe(1);
});
it("Dever retornar 3 quando passamos o array [1, 2]", () => {
expect(sum([1, 2])).toBe(3);
});
it("Dever retornar 6 quando passamos o array [1, 2, 3]", () => {
expect(sum([1, 2, 3])).toBe(6);
});
it("Dever retornar 10 quando passamos o array [1, 2, 3, 4]", () => {
expect(sum([1, 2, 3, 4])).toBe(10);
});
it("Dever retornar 15 quando passamos o array [1, 2, 3, 4, 5]", () => {
expect(sum([1, 2, 3, 4, 5])).toBe(15);
});
it("Dever retornar 27 quando passamos o array [4, 6, 12, 5]", () => {
expect(sum([4, 6, 12, 5])).toBe(27);
});
it("Dever retornar 3886 quando passamos o array [9, 234, 312, 999, 21 , 2311]", () => {
expect(sum([9, 234, 312, 999, 21 , 2311])).toBe(3886);
});
it("Dever retornar 73098 quando passamos o array [533, 234, 23423, 32, 48876]", () => {
expect(sum([533, 234, 23423, 32, 48876])).toBe(73098);
});
// Criar um teste para numeros negativos
it("Dever retornar -51 quando passamos o array [-1, -5, -10, -45]", () => {
expect(sum([-1, 5, -10, -45])).toBe(-51);
});
it("Dever retornar -40 quando passamos o array [-2, -7, -31]", () => {
expect(sum([-2, -7, -31])).toBe(-51);
})
});

11
06-sum/readme.md Normal file
View File

@ -0,0 +1,11 @@
# Desafio 05: Soma dos elementos
Faça um algoritmo que retorne a soma de todos os números de um array
## Exemplo
```js
sum([1, 2, 3, 4, 5]) // 15
sum([10, 10, 10, 10]) // 40
sum([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) // 55
```

4
07-sumEven/index.js Normal file
View File

@ -0,0 +1,4 @@
export function sumEven(value) {
// implementar logica aqui
}

52
07-sumEven/index.test.js Normal file
View File

@ -0,0 +1,52 @@
import { sumEven } from ".";
// soma somente os valors pares de um array
describe("sumEven", () => {
it("Dever retornar 0 quando passamos o array vazio", () => {
expect(sumEven([])).toBe(0);
});
it("Dever retornar 0 quando passamos o array [1]", () => {
expect(sumEven([1])).toBe(0);
});
it("Dever retornar 2 quando passamos o array [1, 2]", () => {
expect(sumEven([1, 2])).toBe(2);
});
it("Dever retornar 2 quando passamos o array [1, 2, 3]", () => {
expect(sumEven([1, 2, 3])).toBe(2);
});
it("Dever retornar 6 quando passamos o array [1, 2, 3, 4]", () => {
expect(sumEven([1, 2, 3, 4])).toBe(6);
});
it("Dever retornar 6 quando passamos o array [1, 2, 3, 4, 5]", () => {
expect(sumEven([1, 2, 3, 4, 5])).toBe(6);
});
it("Dever retornar 22 quando passamos o array [4, 6, 12, 5]", () => {
expect(sumEven([4, 6, 12, 5])).toBe(22);
});
it("Dever retornar 546 quando passamos o array [9, 234, 312, 999, 21 , 2311]", () => {
expect(sumEven([9, 234, 312, 999, 21, 2311])).toBe(546);
});
it("Dever retornar 73098 quando passamos o array [533, 234, 23423, 32, 48876]", () => {
expect(sumEven([533, 234, 23423, 32, 48876])).toBe(49142);
});
it("Dever retornar -10 quando passamos o array [-1, -5, -10, -45]", () => {
expect(sumEven([-1, 5, -10, -45])).toBe(-10);
});
it("Dever retornar -2 quando passamos o array [-2, -7, -31]", () => {
expect(sumEven([-2, -7, -31])).toBe(-2);
})
it("Dever retornar 18 quando passamos o array [-2, 20, -31]", () => {
expect(sumEven([-2, 20, -31])).toBe(18);
})
});

11
07-sumEven/readme.md Normal file
View File

@ -0,0 +1,11 @@
# Desafio 07: Soma numeros pares
Faça um algoritmo que retorne a soma de todos os números pares de um array
## Exemplo
```js
sumEven([1, 2, 3, 4, 5]) // 6
sumEven([10, 10, 10, 10]) // 40
```

4
08-isAnagram/index.js Normal file
View File

@ -0,0 +1,4 @@
export function isAnagram(word1, word2) {
// implementar logica aqui
}

View File

@ -0,0 +1,27 @@
import { isAnagram } from ".";
describe("isAnagram", () => {
it("Dever retornar true quando passamos as palavras \"roma\" e \"amor\"", () => {
expect(isAnagram("roma", "amor")).toBe(true);
});
ít("Dever retornar true quando passamos as palavras \"Buckethead\" e \"DeathCubeK\"", () => {
expect(isAnagram("Buckethead", "DeathCubeK")).toBe(true);
});
ít("Dever retornar true quando passamos as palavras \"Twoo\" e \"WooT\"", () => {
expect(isAnagram("Twoo", "WooT")).toBe(true);
});
ít("Dever retornar false quando passamos as palavras \"dumble\" e \"bumble\"", () => {
expect(isAnagram("dumble", "bumble")).toBe(false);
});
ít("Dever retornar false quando passamos as palavras \"ound\" e \"round\"", () => {
expect(isAnagram("ound", "round")).toBe(false);
});
ít("Dever retornar false quando passamos as palavras \"apple\" e \"pale\"", () => {
expect(isAnagram("apple", "pale")).toBe(false);
});
});

13
08-isAnagram/readme.md Normal file
View File

@ -0,0 +1,13 @@
# Desafio 08: Anagrama
Faça um algoritmo que retorne se um palavra é anagram da outra
## Exemplo
```js
isAnagram('roma', 'amor') // true
isAnagram('roma', 'amora') // false
isAnagram('roma', 'amora') // false
```

View File

@ -0,0 +1,4 @@
export function mostUsedChar(text) {
// implementar logica aqui
return ""
}

View File

@ -0,0 +1,19 @@
import { mostUsedChar } from ".";
describe("mostUsedChar", () => {
it("Dever retornar 'f' quando passamos a palavra 'fdgdfgff'", () => {
expect(mostUsedChar("fdgdfgff")).toBe("f");
});
it("Dever retornar 'm' quando passamos a palavra 'Lorem ipsum'", () => {
expect(mostUsedChar("Lorem ipsum")).toBe("m");
});
it("Dever retornar 's' quando passamos a palavra 'adsassdasd'", () => {
expect(mostUsedChar("adsassdasd")).toBe("s");
});
it("Dever retornar 'e' quando passamos a palavra 'testeeeee'", () => {
expect(mostUsedChar("testeeeee")).toBe("e");
});
});

View File

@ -0,0 +1,13 @@
# Desafio 04: caractere mais repetido
Faça um algoritmo que retorne a a letra mias repetida de uma string
## Exemplo
```js
mostRepeatedChar('a') // 'a'
mostRepeatedChar('aab') // 'a'
mostRepeatedChar('aabb') // 'a'
mostRepeatedChar('banana') // 'a'
```

4
10-longestWords/index.js Normal file
View File

@ -0,0 +1,4 @@
export function longestWords(words) {
// implementar logica aqui
}

View File

@ -0,0 +1,28 @@
import { longestWords } from '.';
describe('longestWords', () => {
it('Dever retornar ["melancia"] quando passamos a lista ["abacaxi", "melancia", "banana"]', () => {
expect(longestWords(["abacaxi", "melancia", "banana"])).toEqual(["melancia"]);
});
it('Dever retornar ["aba", "aa", "ad", "vcd", "aba"] quando passamos a lista ["aba","vcd", "aba"]', () => {
expect(longestWords(["aba", "aa", "ad", "vcd", "aba"])).toEqual(["aba", "vcd", "aba"]);
});
it('Dever retornar ["aa"] quando passamos a lista ["aa"]', () => {
expect(longestWords(["aa"])).toEqual(["aa"]);
});
it('Dever retornar ["eeee", "abcd"] quando passamos a lista ["abc", "eeee", "abcd", "dcd"]', () => {
expect(longestWords(["abc", "eeee", "abcd", "dcd"])).toEqual(["eeee", "abcd"]);
});
it('Dever retornar ["aa", "bb", "cc"] quando passamos a lista ["aa", "bb", "cc"]', () => {
expect(longestWords(["aa", "bb", "cc"])).toEqual(["aa", "bb", "cc"]);
});
it('Dever retornar ["zzzzzz", "abcdef", "aaaaaa"] quando passamos a lista ["a", "abc", "cbd", "zzzzzz", "a", "abcdef", "asasa", "aaaaaa"]', () => {
expect(longestWords(["a", "abc", "cbd", "zzzzzz", "a", "abcdef", "asasa", "aaaaaa"])).toEqual(["zzzzzz", "abcdef", "aaaaaa"]);
});
});

11
10-longestWords/readme.md Normal file
View File

@ -0,0 +1,11 @@
# Desafio 10: Lista de palavras mais longas
Faça um algoritmo que retorne uma lista com as palavras mais longas de uma lista de palavras.
## Exemplo
```js
longestWords(['oi', 'tudo', 'bem']) // ['tudo']
longestWords(['Javascript', 'é', 'show']) // ['Javascript']
longestWords(["aba", "aa", "ad", "vcd", "aba"]) // ["aba", "vcd", "aba"]
```

196
jest.config.js Normal file
View File

@ -0,0 +1,196 @@
/*
* For a detailed explanation regarding each configuration property, visit:
* https://jestjs.io/docs/configuration
*/
export default {
// All imported modules in your tests should be mocked automatically
// automock: false,
// Stop running tests after `n` failures
// bail: 0,
// The directory where Jest should store its cached dependency information
// cacheDirectory: "C:\\Users\\marlo\\AppData\\Local\\Temp\\jest",
// Automatically clear mock calls, instances, contexts and results before every test
// clearMocks: false,
// Indicates whether the coverage information should be collected while executing the test
// collectCoverage: false,
// An array of glob patterns indicating a set of files for which coverage information should be collected
// collectCoverageFrom: undefined,
// The directory where Jest should output its coverage files
// coverageDirectory: undefined,
// An array of regexp pattern strings used to skip coverage collection
// coveragePathIgnorePatterns: [
// "\\\\node_modules\\\\"
// ],
// Indicates which provider should be used to instrument code for coverage
coverageProvider: "v8",
transform: {},
// A list of reporter names that Jest uses when writing coverage reports
// coverageReporters: [
// "json",
// "text",
// "lcov",
// "clover"
// ],
// An object that configures minimum threshold enforcement for coverage results
// coverageThreshold: undefined,
// A path to a custom dependency extractor
// dependencyExtractor: undefined,
// Make calling deprecated APIs throw helpful error messages
// errorOnDeprecated: false,
// The default configuration for fake timers
// fakeTimers: {
// "enableGlobally": false
// },
// Force coverage collection from ignored files using an array of glob patterns
// forceCoverageMatch: [],
// A path to a module which exports an async function that is triggered once before all test suites
// globalSetup: undefined,
// A path to a module which exports an async function that is triggered once after all test suites
// globalTeardown: undefined,
// A set of global variables that need to be available in all test environments
// globals: {},
// The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
// maxWorkers: "50%",
// An array of directory names to be searched recursively up from the requiring module's location
// moduleDirectories: [
// "node_modules"
// ],
// An array of file extensions your modules use
// moduleFileExtensions: [
// "js",
// "mjs",
// "cjs",
// "jsx",
// "ts",
// "tsx",
// "json",
// "node"
// ],
// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
// moduleNameMapper: {},
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
// modulePathIgnorePatterns: [],
// Activates notifications for test results
// notify: false,
// An enum that specifies notification mode. Requires { notify: true }
// notifyMode: "failure-change",
// A preset that is used as a base for Jest's configuration
// preset: undefined,
// Run tests from one or more projects
// projects: undefined,
// Use this configuration option to add custom reporters to Jest
// reporters: undefined,
// Automatically reset mock state before every test
// resetMocks: false,
// Reset the module registry before running each individual test
// resetModules: false,
// A path to a custom resolver
// resolver: undefined,
// Automatically restore mock state and implementation before every test
// restoreMocks: false,
// The root directory that Jest should scan for tests and modules within
// rootDir: undefined,
// A list of paths to directories that Jest should use to search for files in
// roots: [
// "<rootDir>"
// ],
// Allows you to use a custom runner instead of Jest's default test runner
// runner: "jest-runner",
// The paths to modules that run some code to configure or set up the testing environment before each test
// setupFiles: [],
// A list of paths to modules that run some code to configure or set up the testing framework before each test
// setupFilesAfterEnv: [],
// The number of seconds after which a test is considered as slow and reported as such in the results.
// slowTestThreshold: 5,
// A list of paths to snapshot serializer modules Jest should use for snapshot testing
// snapshotSerializers: [],
// The test environment that will be used for testing
// testEnvironment: "jest-environment-node",
// Options that will be passed to the testEnvironment
// testEnvironmentOptions: {},
// Adds a location field to test results
// testLocationInResults: false,
// The glob patterns Jest uses to detect test files
// testMatch: [
// "**/__tests__/**/*.[jt]s?(x)",
// "**/?(*.)+(spec|test).[tj]s?(x)"
// ],
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
// testPathIgnorePatterns: [
// "\\\\node_modules\\\\"
// ],
// The regexp pattern or array of patterns that Jest uses to detect test files
// testRegex: [],
// This option allows the use of a custom results processor
// testResultsProcessor: undefined,
// This option allows use of a custom test runner
// testRunner: "jest-circus/runner",
// A map from regular expressions to paths to transformers
// transform: undefined,
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
// transformIgnorePatterns: [
// "\\\\node_modules\\\\",
// "\\.pnp\\.[^\\\\]+$"
// ],
// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
// unmockedModulePathPatterns: undefined,
// Indicates whether each individual test should be reported during the run
// verbose: undefined,
// An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
// watchPathIgnorePatterns: [],
// Whether to use watchman for file crawling
// watchman: true,
};

5405
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

20
package.json Normal file
View File

@ -0,0 +1,20 @@
{
"name": "challenge-algorithms",
"version": "1.0.0",
"description": "Desafios de algoritmos do curso de JavaScript da M3 academy",
"main": "index.js",
"private": true,
"scripts": {
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js"
},
"repository": {
"type": "git",
"url": "ssh://git@gitea.ecommercetools.com.br:22022/M3-Academy/challenge-algorithms.git"
},
"author": "m3-academy",
"type": "module",
"license": "ISC",
"dependencies": {
"jest": "^29.2.2"
}
}

56
readme.md Normal file
View File

@ -0,0 +1,56 @@
# M3 academy - desafios algoritmos
## Introdução
Este repositório contém os desafios de algoritmos da M3 academy.
Dentro de cada pasta, você encontrará um arquivo README.md com as instruções do desafio.
## Antes de começar
Para executar os desafios, você precisará ter instalado em sua máquina o [Node.js](https://nodejs.org/en/).
1. Depois de clonar o repositório, acesse o seu terminal e digite o comando `npm install` para instalar as dependências do projeto.
## Instruções
- Acesse a pasta do desafio que deseja fazer
- Leia o arquivo README.md dentro da pasta
- Abra o arquivo `index.js` e implemente a sua solução dentro da função que está sendo exportada.
- Para testar a sua solução, execute o comando `npm test` no terminal. Seu código deve passar em todos os testes para ser considerado uma solução válida
## Observações
- Não modifique o nome dos arquivos e nem o nome da função
- Não modifique os arquivos de teste (arquivos que terminam com `.test.js`)
## Como executar os desafios
Você pode executar os desafios de duas formas:
- Executar o teste de todos os desafios com o comando `npm test`
- Executar o teste de um desafio específico com o comando `npm test -t <nome-da-função-do-desafio>`
```shell
npm test -t greet
npm test -t isPrime
```
- Ou acessar a pasta do desafio e executar o comando `node index` para executar um código de um desafio especifico ex:
```js
cd 01-greeting
node index
```
-
## Desafios
- [01-greeting](./01-greeting/readme.md)
- [02-area-do-triangulo](./02-triangleArea/readme.md)
- [03-max-value](./03-maxValue/readme.md)
- [04-fibonnaci](./04-fibonnaci/readme.md)
- [05-isPrime](./05-isPrime/readme.md)
- [06-soma-dos-elementos](./06-sum/readme.md)
- [07-soma-dos-pares](./07-sumEven/readme.md)
- [08-anagrama](./08-isAnagram/readme.md)
- [09-caractere-mais-repetido](./09-mostUsedChar/readme.md)
- [10-lista-palavras-mais-longas](./10-longestWords/readme.md)