You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 14, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+45-9Lines changed: 45 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,51 @@
1
-
Like learning a musical instrument, programming requires daily practise.
1
+
# Coursework
2
2
3
-
The exercises are split into three folders: `exercises`, `mandatory` and `extra`. All homework in the `exercise` and `mandatory` section **must** be completed for homework by the following lesson.
3
+
Like learning a musical instrument, programming requires daily practice.
4
+
5
+
The exercises are split into two folders: `mandatory` and `extra`. All homework in the `mandatory` section **must** be completed for homework by the following lesson.
4
6
5
7
The `extra` folder contains exercises that you can complete to challenge yourself, but are not required for the following lesson.
6
8
9
+
If you think you need to do more practice with the basics, then you can find some more exercises listed in `resources.md`. These exercises are not mandatory and won't be assigned as part of your coursework for the week.
10
+
11
+
## Setting up your code editor
12
+
13
+
14
+
There are some tools that will help you to write code. One of these, [Prettier](https://prettier.io/), formats your code, making it easier for you and others to read.
15
+
16
+
### 1. Install prettier
17
+
18
+
- In Visual Studio open the extensions panel (see https://code.visualstudio.com/docs/editor/extension-gallery#_browse-and-install-extensions)
19
+
- Search for `Prettier - Code formatter`
20
+
- Click install on the top result
21
+
22
+
### 2. Enable formatting on save
23
+
24
+
- In Visual Studio open the settings file (see https://code.visualstudio.com/docs/getstarted/settings#_creating-user-and-workspace-settings)
25
+
- Search for `editor format`
26
+
- Set `editor.formatOnSave` and `editor.formatOnPaste` to true
27
+
28
+
29
+
## Running the code/tests
30
+
31
+
The files for the mandatory/extra exercises are intended to be run as jest tests.
32
+
33
+
- Once you have cloned the repository, run `npm install` once in the terminal to install jest (and any necessary dependencies).
34
+
- To run the tests for all mandatory/extra exercises, run `npm test`
35
+
- To run only the tests for the mandatory exercises, run `npm test -- --selectProjects mandatory`
36
+
- To run only the tests for the extra exercises, run `npm test -- --selectProjects extra`
37
+
- To run a single exercise/test (for example `mandatory/1-writer.js`), run `npm test -- --testPathPattern mandatory/1-writer.js` (Remember, you can use tab-completion to get files relative to the current directory, so m`Tab ↹`/1-`Tab ↹` will autocomplete get you the test file starting with 1-)
This is a **private** repository. Please request access from your Teachers, Buddy or City Coordinator after the start of your next lesson.
14
56
15
-
## Testing your work
16
-
17
-
- Each of the *.js files in the `exercises` folder can be run from the terminal using the `node` command with the path to the file. For example, `node exercises/B-boolean-literals/exercise.js` can be run from the root of the project.
18
-
- To run the tests in the `mandatory` folder, run `npm run test` from the root of the project (after having run `npm install` once before).
19
-
- To run the tests in the `extra` folder, run `npm run extra-tests` from the root of the project (after having run `npm install` once before).
20
-
21
57
## Instructions for submission
22
58
23
-
For your homework, we'll be using [**test driven development**](https://medium.com/@adityaalifnugraha/test-driven-development-tdd-in-a-nutshell-b9e05dfe8adb)to check your answers. Test driven development (or TDD) is the practice of writing tests for your code first, and then write your code to pass those tests. This is a very useful way of writing good quality code and is used in a lot of industries. You don't have to worry about knowing how this works, but if you're curious, engage with a volunteer to find out more! :)
59
+
For your homework, we'll be using tests to check your answers. The tests will assert that your functions behave in the correct way. A **failing test** ❌ indicates that a function _is not_ behaving correctly; a **passing test** ✅ indicates that your function is behaving correctly.
24
60
25
61
1. Complete the challenges in each file and save it once you're happy with your changes
26
62
2. Run the script to check the results against the tests - all tests should read PASSED if you completed the challenges correctly. If a test reads FAILED, find the associated test to identify which function failed and fix it.
0 commit comments