Skip to content

Commit 807bdc5

Browse files
Manipulate dome test cases to be sure of the flexibility
1 parent ecdf2d1 commit 807bdc5

File tree

2 files changed

+6
-29
lines changed

2 files changed

+6
-29
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const addAll = require('./addAll');
1+
const addAll = require("./addAll");
22

33
describe("Testing add operation for Infinite numbers", () => {
44
it("Addition of 1 and 1 equals 2", () => {
@@ -8,12 +8,12 @@ describe("Testing add operation for Infinite numbers", () => {
88
expect(addAll(11, 2, 3, 4, 5, 6, 7, 8, 8, 9, 10)).toBe(73);
99
});
1010
it("Parameter should at least be two", () => {
11-
expect(addAll(1)).toMatch(/least two Number/);
11+
expect(addAll()).toMatch(/least two Number/);
1212
});
1313
it("Parameter should only be Numbers", () => {
1414
function logError() {
1515
addAll([], 2, 3, 4, 5, 6, 7, 8, 8, 9, 10);
1616
}
1717
expect(logError).toThrowError(Error);
1818
});
19-
});
19+
});

operations/git_api/getRepo.js

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,18 @@
11
const fetch = require("node-fetch");
2+
let count = 0;
23

34
function showGitHubRepos(handle) {
45
if (typeof handle === "string") {
56
const url = `https://api.github.com/users/${handle}/repos`;
7+
console.log("Count:", ++count)
68
return fetch(url, { method: "GET" }).then(response =>
7-
response.map(elem => elem.name)
9+
response.map(repo => repo.name)
810
);
911
} else {
1012
return "Please Input a valid Git username";
1113
}
1214
}
1315
//showGitHubRepos("whiteh").then(data => console.log(data));
1416

15-
const myrepo = [
16-
"Ball-Bouncing-and-Collision",
17-
"css-grid",
18-
"CSS-Grid-Calculator",
19-
"CSS-Grid-Phone",
20-
"css-protips",
21-
"Databaseless-API",
22-
"front-end-interview-handbook",
23-
"git-blog-demo",
24-
"html5games1",
25-
"Introductory-Website",
26-
"Javascript-30",
27-
"jsninja2",
28-
"learn-git",
29-
"learn-git-basics",
30-
"learn-git-the-right-way",
31-
"Modernizr",
32-
"my_git_note",
33-
"reddit-fetch-api",
34-
"SendIT",
35-
"test-demo",
36-
"travis-intro",
37-
"You-Dont-Know-JS",
38-
"Zootopia-App"
39-
];
4017

4118
module.exports = showGitHubRepos;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy