Skip to content

Commit c229426

Browse files
authored
Merge branch 'CodeYourFuture:main' into acoursework/sprint-2
2 parents 5eb1ab8 + 8f3d6cf commit c229426

33 files changed

+185
-213
lines changed

.github/FUNDING.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,2 @@
1-
# These are supported funding model platforms
2-
31
github: CodeYourFuture
4-
patreon: # Replace with a single Patreon username
5-
open_collective: # Replace with a single Open Collective username
6-
ko_fi: # Replace with a single Ko-fi username
7-
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8-
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9-
liberapay: # Replace with a single Liberapay username
10-
issuehunt: # Replace with a single IssueHunt username
11-
otechie: # Replace with a single Otechie username
12-
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
132
custom: https://codeyourfuture.io/donate

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
blank_issues_enabled: false
1+
blank_issues_enabled: true
22
contact_links:
33
- name: CYF
44
url: contact@codeyourfuture.io
@@ -8,7 +8,7 @@ contact_links:
88
about: Join CYF here
99
- name: CYF Slack
1010
url: codeyourfuture.slack.com
11-
about: Come to #cyf-syllabus-tech and chat
11+
about: Come to #cyf-curriculum and chat
1212
- name: CYF Tech Ed
1313
url: https://github.com/orgs/CodeYourFuture/teams/mentors
1414
about: CYF mentors on Github

.github/ISSUE_TEMPLATE/pd-assignment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: PD Coursework
22
description: Assign a piece of PD coursework
33
title: "[PD] <title>"
4-
labels: [PD, 🏝 Priority Stretch, 🐇 Size Small]
4+
labels: [PD, 🏝 Priority Stretch, 🐇 Size Small, 📅 Sprint 1]
55
body:
66
- type: markdown
77
attributes:

.github/ISSUE_TEMPLATE/tech-ed-assignment.yml

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,34 @@
11
name: Tech Ed Coursework
22
description: Assign a piece of technical coursework
3-
title: "[TECH ED] <title>"
4-
labels: [Tech Ed, 🏕 Priority Mandatory, 🐂 Size Medium]
3+
title: "<title>"
4+
labels: [Tech Ed, 🏕 Priority Mandatory, 🐂 Size Medium, 📅 Sprint 1]
55
body:
66
- type: markdown
77
attributes:
88
value: |
9-
Thanks for taking the time to assign this coursework!
9+
Thanks for taking the time to assign this coursework!
1010
11-
To support our trainees with planning and prioritising their own learning journey, we want our coursework assignments to be more informative.
11+
To support our trainees with planning and prioritising their own learning journey, we want our coursework assignments to be more informative.
1212
We don't just want to tell them what to do, we want to tell them stuff like:
1313
- why we are doing it
1414
- what it's "for" (problem-solving, debugging, etc)
1515
- how long they should spend on it, maximum
16-
- how to get help
17-
- how to review it with answers
16+
- how to get help
17+
- how to review it with answers
1818
- how to get it reviewed from mentors and peers
1919
- type: input
2020
attributes:
2121
label: Link to the coursework
2222
validations:
2323
required: true
24+
- type : textarea
25+
attributes:
26+
label: Learning Objectives
27+
description: https://common.codeyourfuture.io/common-theme/shortcodes/objectives/
28+
placeholder: |
29+
<!--{{<objectives}}-->
30+
- [ ] CYF format, task list formatting
31+
<!--{{</objectives}}-->
2432
- type: textarea
2533
attributes:
2634
label: Why are we doing this?
@@ -37,14 +45,14 @@ body:
3745
attributes:
3846
label: How to get help
3947
description: State simply how trainees can get help with this assignment
40-
placeholder: |
48+
value: |
4149
Share your blockers in your class channel
42-
https://syllabus.codeyourfuture.io/guides/asking-questions
50+
https://curriculum.codeyourfuture.io/guides/getting-help/asking-questions/
4351
- type: textarea
4452
attributes:
4553
label: How to submit
4654
description: State in clear steps how a trainee can submit this assignment.
47-
placeholder: |
55+
value: |
4856
Fork the repo to your own GitHub account
4957
Make regular small commits with clear messages
5058
When you are ready, open a Pull Request to the CYF repo
@@ -72,9 +80,9 @@ body:
7280
1. Update labels
7381
- priority -- is this coursework key, mandatory, or stretch? Pick one.
7482
- size -- help trainees plan their time with rough estimation. Pick one
75-
- topics -- add all that seem relevant to you.
76-
2. Add to milestone
77-
- week 1,2,3,4
83+
- topics -- add all that seem relevant to you.
84+
2. Add a Sprint label to add to the backlog view
85+
- sprint 1,2,3,4
7886
7987
Once your ticket is complete, you may like to add it to the example project board attached to this repo.
8088
This is so you understand how trainees will use your work. Nobody has built a board copier yet, so trainees will be doing this step themselves.

.github/pull_request_template.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,30 @@
22
33
You must title your PR like this:
44
5-
REGION | COHORT_NAME | FIRST_NAME LAST_NAME | PROJ_NAME
5+
Region | Cohort | FirstName LastName | Sprint | Assignment Title
66
77
For example,
88
9-
London | May-2025 | Carol Owen | Sprint-1
9+
London | 25-ITP-May | Carol Owen | Sprint 1 | Alarm Clock
1010
11-
Complete the task list below this message.
12-
If your PR is rejected, check the task list.
11+
Fill in the template below - remove any sections that don't apply.
12+
13+
Complete the self checklist - replace each empty box in the checklist [ ] with a [x].
14+
15+
Add the label "Needs Review" and you will get review.
16+
17+
Respond to volunteer reviews until the volunteer marks it as "Complete".
1318
1419
-->
1520

1621
## Learners, PR Template
1722

1823
Self checklist
1924

20-
- [ ] I have committed my files one by one, on purpose, and for a reason
21-
- [ ] I have titled my PR with REGION | COHORT_NAME | FIRST_NAME LAST_NAME | PROJ_NAME
25+
- [ ] I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
26+
- [ ] My changes meet the requirements of the task
2227
- [ ] I have tested my changes
23-
- [ ] My changes follow the [style guide](https://curriculum.codeyourfuture.io/guides/contributing/)
24-
- [ ] My changes meet the [requirements](./README.md) of this task
28+
- [ ] My changes follow the [style guide](https://curriculum.codeyourfuture.io/guides/reviewing/style-guide/)
2529

2630
## Changelist
2731

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Validate PR Metadata
2+
on:
3+
pull_request_target:
4+
types:
5+
- labeled
6+
- unlabeled
7+
- opened
8+
- edited
9+
- reopened
10+
11+
jobs:
12+
validate_pr_metadata:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: CodeYourFuture/actions/validate-pr-metadata@main
17+
with:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

HOW_TO_REVIEW.md

Lines changed: 0 additions & 52 deletions
This file was deleted.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Implement solutions and rewrite tests with Jest
2+
3+
## 1 Implement solutions
4+
5+
In the `implement` directory you've got a number of functions you'll need to implement.
6+
For each function, you also have a number of different cases you'll need to check for your function.
7+
8+
Write your assertions and build up your program case by case. Don't rush to a solution. The point of these assignments is to learn how to write assertions and build up a program step by step.
9+
10+
Here is a recommended order:
11+
12+
1. `1-get-angle-type.js`
13+
2. `2-is-proper-fraction.js`
14+
3. `3-get-card-value.js`
15+
16+
## 2 Rewrite tests with Jest
17+
18+
`console.log` is most often used as a debugging tool. We use to inspect the state of our program during runtime.
19+
20+
We can use `console.assert` to write assertions: however, it is not very easy to use when writing large test suites. In the first section, Implement, we used a custom "helper function" to make our assertions more readable.
21+
22+
Jest is a whole library of helper functions we can use to make our assertions more readable and easier to write.
23+
24+
Your new task is to write the same tests as you wrote in the `implement` directory, but using Jest instead of `console.assert`.
25+
26+
You shouldn't have to change the contents of `implement` to write these tests.
27+
28+
There are files for your Jest tests in the `rewrite-tests-with-jest` directory. They will automatically use the functions you already implemented.
29+
30+
You can run all the tests in this repo by running `npm test` in your terminal. However, VSCode has a built-in test runner that you can use to run the tests, and this should make it much easier to focus on building up your test cases one at a time.
31+
32+
https://code.visualstudio.com/docs/editor/testing
33+
34+
1. Go to rewrite-tests-with-jest/1-get-angle-type.test.js
35+
2. Click the green play button to run the test. It's on the left of the test function in the gutter.
36+
3. Read the output in the TEST_RESULTS tab at the bottom of the screen.
37+
4. Explore all the tests in this repo by opening the TEST EXPLORER tab. The logo is a beaker.
38+
39+
![VSCode Test Runner](../../run-this-test.png)
40+
41+
![Test Results](../../test-results-output.png)
42+
43+
> [!TIP]
44+
> You can always run a single test file by running `npm test path/to/test-file.test.js`.

Sprint-3/1-key-implement/1-get-angle-type.js renamed to Sprint-3/1-implement-and-rewrite-tests/implement/1-get-angle-type.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,17 @@
88
// Then, write the next test! :) Go through this process until all the cases are implemented
99

1010
function getAngleType(angle) {
11-
if (angle === 90) return "Right angle";
12-
// read to the end, complete line 36, then pass your test here
11+
if (angle === 90) {
12+
return "Right angle";
13+
}
14+
// Run the tests, work out what Case 2 is testing, and implement the required code here.
15+
// Then keep going for the other cases, one at a time.
1316
}
1417

18+
// The line below allows us to load the getAngleType function into tests in other files.
19+
// This will be useful in the "rewrite tests with jest" step.
20+
module.exports = getAngleType;
21+
1522
// we're going to use this helper function to make our assertions easier to read
1623
// if the actual output matches the target output, the test will pass
1724
function assertEquals(actualOutput, targetOutput) {

Sprint-3/1-key-implement/2-is-proper-fraction.js renamed to Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,15 @@
88
// write one test at a time, and make it pass, build your solution up methodically
99

1010
function isProperFraction(numerator, denominator) {
11-
if (numerator < denominator) return true;
11+
if (numerator < denominator) {
12+
return true;
13+
}
1214
}
1315

16+
// The line below allows us to load the isProperFraction function into tests in other files.
17+
// This will be useful in the "rewrite tests with jest" step.
18+
module.exports = isProperFraction;
19+
1420
// here's our helper again
1521
function assertEquals(actualOutput, targetOutput) {
1622
console.assert(

0 commit comments

Comments
 (0)