Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 650638c

Browse filesBrowse files
Delete db.js and restructure folder
1 parent 804a612 commit 650638c
Copy full SHA for 650638c

File tree

Expand file treeCollapse file tree

4 files changed

+1
-49
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+1
-49
lines changed

‎.gitignore

Copy file name to clipboardExpand all lines: .gitignore
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ logs
33
*.log
44
node_modules
55
package-lock.json
6-
*operations/tempCodeRunnerFile.js
6+
*tempCodeRunnerFile.js
77

88
#
99
# Optional npm cache directory

‎operations/git_api/db.js

Copy file name to clipboardExpand all lines: operations/git_api/db.js
-3Lines changed: 0 additions & 3 deletions
This file was deleted.

‎operations/git_api/getRepo.js

Copy file name to clipboard
-7Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,2 @@
11
//Takes a username as an argument and makes a call to GitHub API
22
//and returns all the repositoriesowned by the user as an array.
3-
const { getCustomer } = require("./db");
4-
5-
module.exports.applyDiscount = function(order) {
6-
const customer = getCustomer(order.customerId);
7-
8-
customer.points > 10 ? (order.totalPrice *= 0.9) : false;
9-
};

‎operations/git_api/getRepo.test.js

Copy file name to clipboard
-38Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1 @@
1-
const getRepo = require("./getRepo");
2-
const db = require("./db");
31

4-
let showGitHubUser = require("./getRepo");
5-
6-
// describe("Testing Mock....", () => {
7-
// it("Should apply discount to total", () => {
8-
// db.getCustomer = function(customerId) {
9-
// console.log("Getting data from fake database");
10-
// return { id: customerId, points: 20 };
11-
// };
12-
13-
// const order = { customerId: 1, totalPrice: 10 };
14-
// getRepo.applyDiscount(order);
15-
16-
// expect(order.totalPrice).toBe(9);
17-
// });
18-
// });
19-
20-
// describe("Mock testing getRepo implementation", () => {
21-
// it("Make sure fetchRepo function is callled", () => {
22-
// const handle = "iKnowJavaScript";
23-
// showGitHubUser = jest
24-
// .fn(handle)
25-
// .mockResolvedValue([
26-
// "Ball-Bouncing-and-Collision",
27-
// "css-grid",
28-
// "CSS-Grid-Calculator",
29-
// "CSS-Grid-Phone",
30-
// "css-protips",
31-
// "Databaseless-API"
32-
// ]);
33-
34-
// expect(showGitHubUser).toHaveBeenCalledWith(handle);
35-
// });
36-
// it("Should make sure an array of repo was return", () => {});
37-
// it("Should return 'User has not repository yet' if it return an empty array", () => {});
38-
// it("Should return 'User not found' if no array was returned", () => {});
39-
// });

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.