Skip to content

Commit 7c36295

Browse files
authored
Merge branch 'code-differently:main' into lesson_06
2 parents 6b4b9a6 + 70dccf2 commit 7c36295

18 files changed

+6116
-2
lines changed

.devcontainer/devcontainer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@
3535
"ms-dotnettools.csdevkit",
3636
"ritwickdey.LiveServer",
3737
"mechatroner.rainbow-csv",
38-
"alexcvzz.vscode-sqlite"
38+
"alexcvzz.vscode-sqlite",
39+
"Orta.vscode-jest",
40+
"firsttris.vscode-jest-runner"
3941
],
4042
"settings": {
4143
"terminal.integrated.defaultProfile.linux": "zsh",
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/typescript/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 check

.github/workflows/check_push.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,10 @@ jobs:
6262
npm ci
6363
npm run compile
6464
65+
- name: Build Lesson 07 with Node.js
66+
working-directory: ./lesson_07/conditionals
67+
run: |
68+
npm ci
69+
npm run compile
70+
6571

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): Finish this
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], 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/.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)