Skip to content

Commit 015ea99

Browse files
committed
populate with content from JS3
1 parent 511a555 commit 015ea99

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+7051
-52
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
**/node_modules
3+
.DS_Store
4+
**/.DS_Store

.prettierrc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"arrowParens": "always",
3+
"bracketSpacing": true,
4+
"embeddedLanguageFormatting": "auto",
5+
"htmlWhitespaceSensitivity": "css",
6+
"insertPragma": false,
7+
"jsxBracketSameLine": false,
8+
"jsxSingleQuote": false,
9+
"printWidth": 80,
10+
"proseWrap": "preserve",
11+
"quoteProps": "as-needed",
12+
"requirePragma": false,
13+
"semi": true,
14+
"singleQuote": false,
15+
"tabWidth": 2,
16+
"trailingComma": "es5",
17+
"useTabs": false,
18+
"vueIndentScriptAndStyle": false
19+
}

Example-Image.jpeg

-910 KB
Binary file not shown.

HOW-TO-GET-HELP.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# How To Get Help
2+
3+
Learning to ask good questions is a key skill for a developer and you should practice this every week at CYF. You must spend a lot of time learning how to describe problems clearly and systematically:
4+
5+
https://curriculum.codeyourfuture.io/guides/asking-questions
6+
7+
Problem-solving is the real (marketable) skill of software developers. If you do not have questions to ask about your work, ask for some different work. Don't miss this opportunity to break down challenging problems with a large team of developers.
8+
9+
## Reporting Issues in Coursework
10+
11+
- Is there a problem with this coursework?
12+
- Have you noticed a bug?
13+
- Is there a typo or a mistake you can help clean up?
14+
15+
Open an issue or PR directly to the main repo. CYF Curriculum is an Open Source project developed on GitHub and you are invited to contribute. Read the Issue Template carefully.
16+
17+
https://github.com/CodeYourFuture/curriculum/

HOW_TO_REVIEW.md

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
<!--
2-
Do not edit this file.
3-
Make a change to the template and then pull changes
4-
Repo: https://github.com/CodeYourFuture/Module-Template
5-
-->
6-
71
# Everyone reviews code at CYF
82

3+
https://curriculum.codeyourfuture.io/guides/reviewing/
4+
95
Mentors and trainees all review code, and collaborate on improving code quality. We are all helping each other to talk, write, and think about code more clearly.
106

117
We are not reviewing code as if we were to merge this PR into production; we are opening a technical conversation for the purpose of insight and development.
@@ -53,14 +49,4 @@ Use these resources to inform your code review, get unstuck, and improve your un
5349

5450
## Guides
5551

56-
Here's a detailed checklist of the sorts of things we should check code for:
57-
58-
https://syllabus.codeyourfuture.io/guides/marking-guide
59-
60-
Here's a detailed style guide to help us all write clear, high quality code:
61-
62-
https://syllabus.codeyourfuture.io/guides/code-style-guide
63-
64-
Here's some help with giving good feedback during code review:
65-
66-
https://teachertraining.codeyourfuture.io/tasks/code-review
52+
https://curriculum.codeyourfuture.io/guides/reviewing/

contributing.md

Lines changed: 0 additions & 25 deletions
This file was deleted.

debugging/book-library/book.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { title, author, pages, read } from "./index.js";
2+
3+
const createBook = (title, author, pages, read) => {
4+
const book = {
5+
title,
6+
author,
7+
pages,
8+
read,
9+
};
10+
return book;
11+
};
12+
13+
export default createBook;

debugging/book-library/book.test.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import createBook from "./book";
2+
3+
describe("createBook", () => {
4+
test("should create a book object", () => {
5+
const title = "The Shining";
6+
const author = "Stephen King";
7+
const pages = 447;
8+
const read = true;
9+
const book = createBook(title, author, pages, read);
10+
11+
expect(book).toEqual({
12+
title: "The Shining",
13+
author: "Stephen King",
14+
pages: 447,
15+
read: true,
16+
});
17+
});
18+
});

debugging/book-library/books.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import createBook from "./book.js";
2+
const addBook = (books, newBook) => [...books, newBook];
3+
4+
// removeBook removes the book at the given index from the list of books
5+
const removeBook = (books, index) => [
6+
...books.slice(0, index),
7+
...books.slice(index + 1),
8+
];
9+
10+
export { createBook, addBook, removeBook };

debugging/book-library/books.test.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { createBook, addBook, removeBook } from "./books";
2+
3+
describe("addBook", () => {
4+
test("adds valid book to list", () => {
5+
const books = [];
6+
const newBook = createBook("ABC", "Author", 100, false);
7+
8+
const updatedBooks = addBook(books, newBook);
9+
10+
expect(updatedBooks).toEqual([newBook]);
11+
});
12+
13+
test("does not add invalid book missing fields", () => {
14+
const books = [];
15+
const invalidBook = createBook("ABC");
16+
17+
const updatedBooks = addBook(books, invalidBook);
18+
19+
expect(updatedBooks).toEqual([]);
20+
});
21+
});
22+
23+
describe("removeBook", () => {
24+
test("removes book at index", () => {
25+
const books = [
26+
createBook("A", "A", 1),
27+
createBook("B", "B", 2),
28+
createBook("C", "C", 3),
29+
];
30+
31+
const updatedBooks = removeBook(books, 1);
32+
33+
expect(updatedBooks).toEqual([
34+
createBook("A", "A", 1),
35+
createBook("C", "C", 3),
36+
]);
37+
});
38+
});
39+
});
40+
});

0 commit comments

Comments
 (0)