Fix/code smells (#1338)

* ♻️ refactor: improving and fixing some code

* Updated Documentation in README.md

* ♻️ refactor: improving isLeapYear

* 🐛 chore: back changes

* 🐛 fix: using reduce instead forEach

* 🐛 fix: using reduce instead forEach

* 🐛 fix: removing duplicated code

* 🐛 chore: removing .js

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
Carlos Rafael
2023-08-21 15:06:43 -03:00
committed by GitHub
parent 9b32db29d8
commit 00e40e6f06
14 changed files with 33 additions and 111 deletions

View File

@ -5,9 +5,7 @@ describe('Test Graph2', () => {
const graph = new Graph(vertices.length)
// adding vertices
for (let i = 0; i < vertices.length; i++) {
graph.addVertex(vertices[i])
}
vertices.forEach((vertice) => graph.addVertex(vertice))
// adding edges
graph.addEdge('A', 'B')
@ -27,7 +25,7 @@ describe('Test Graph2', () => {
expect(mockFn.mock.calls.length).toBe(vertices.length)
// Collect adjacency lists from output (call args)
const adjListArr = mockFn.mock.calls.map(v => v[0])
const adjListArr = mockFn.mock.calls.map((v) => v[0])
expect(adjListArr).toEqual([
'A -> B D E ',