Skip to content

Commit 4a0cec5

Browse files
committed
feat: adds lesson_07 homework and lesson_08 pre-work
Signed-off-by: Anthony D. Mays <[email protected]>
1 parent b87802c commit 4a0cec5

28 files changed

+6624
-1
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Check Lesson 07 Pull Request
2+
3+
on:
4+
pull_request:
5+
branches: [ "main" ]
6+
paths:
7+
- "lesson_07/conditionals/**"
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Use Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '20.x'
23+
24+
- name: Build Shared Lib with Node.js
25+
working-directory: ./lib/javascript/codedifferently-instructional
26+
run: npm ci
27+
28+
- name: Build Lesson 07 with Node.js
29+
working-directory: ./lesson_07/conditionals
30+
run: |
31+
npm ci
32+
npm run test

.github/workflows/check_push.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
- "lesson_03/quiz/**"
1111
- "lesson_06/quiz/**"
1212
- "lesson_06/expression/**"
13+
- "lesson_07/conditionals/**"
1314
jobs:
1415
build:
1516
runs-on: ubuntu-latest
@@ -86,3 +87,9 @@ jobs:
8687
run: |
8788
npm ci
8889
npm run compile
90+
91+
- name: Build Lesson 07 with Node.js
92+
working-directory: ./lesson_07/conditionals
93+
run: |
94+
npm ci
95+
npm run compile

lesson_07/README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,12 @@ Please review the following resources before lecture:
1010

1111
## Homework
1212

13-
- [ ] TODO(anthonydmays): Add homework details
13+
- [ ] Complete [Conditionals and Loops](#conditionals-and-loops) exercise.
14+
- [ ] Do pre-work for [lesson 08](/lesson_08/).
15+
16+
## Conditionals and Loops
17+
18+
This exercise will provide you ample opportunities to practice your understanding of conditional expressions and loops. To complete this assignment, implement the functions in [lesson7.ts][lesson7-file] and in the code file for your assigned homework group, ensure the tests pass, and submit a PR. Remember to use the [Conventional Commits][conventional-commits] spec for your commit messages and pull requests.
19+
20+
[lesson7-file]: ./conditionals/src/lesson7.ts
21+
[conventional-commits]: https://www.conventionalcommits.org/en/v1.0.0/

lesson_07/conditionals/.editorconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
insert_final_newline = true

lesson_07/conditionals/.env.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
HW_VERSION=your homework version here

lesson_07/conditionals/.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build/
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Ignore artifacts:
2+
build
3+
coverage

lesson_07/conditionals/.prettierrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// @ts-check
2+
3+
import eslint from "@eslint/js";
4+
import tseslint from "typescript-eslint";
5+
import eslintConfigPrettier from "eslint-config-prettier";
6+
7+
export default tseslint.config(
8+
eslint.configs.recommended,
9+
...tseslint.configs.strict,
10+
...tseslint.configs.stylistic,
11+
eslintConfigPrettier,
12+
{
13+
ignores: ["build"],
14+
},
15+
);

lesson_07/conditionals/jest.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/** @type {import('ts-jest').JestConfigWithTsJest} **/
2+
export default {
3+
testEnvironment: "node",
4+
transform: {
5+
"^.+.tsx?$": ["ts-jest", { useESM: true }],
6+
},
7+
moduleNameMapper: {
8+
"^(\\.\\.?\\/.+)\\.js$": "$1",
9+
},
10+
extensionsToTreatAsEsm: [".ts"],
11+
};

0 commit comments

Comments
 (0)