Skip to content

Commit b64f963

Browse files
authored
feat: adds lesson_02 homework (#55)
* feat: commit working version of lesson_02 quiz * feat: configure tests for lesson_02 * chore: updates readme instructions * fix: ensures proper path to quiz config. * chore: add lesson_03 pre-work * chore: minor nit changes * chore: refactors to do hash replacement once per config load. * chore: add test for QuizConfig
1 parent 979724a commit b64f963

23 files changed

+6375
-32
lines changed

README.md

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

lesson_02/README.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,37 @@ Please review the following resources before lecture:
88

99
## Homework
1010

11-
TODO(anthonydmays): Add this
11+
- [ ] Complete [Lesson 02 quiz](#lesson-02-quiz-instructions)
12+
- [ ] Do pre-work for [lesson 03](/lesson_03/).
13+
14+
### Prerequisites
15+
16+
To complete this assignment, you must have **Docker** and **VS Code** with the [**Dev Containers**][dev-containers-link] extension installed.
17+
18+
### Lesson 02 Quiz Instructions
19+
20+
For this assignment, you will complete a quiz by modifying a TypeScript application. Within the quiz project, there are tests that you will need to make pass in order to submit your answers. Here are the instructions for completing the assignment:
21+
22+
1. Make sure to sync your fork to pull in the latest changes.
23+
2. Open the project in **VS Code** and make sure to select `Reopen in Container` when prompted.
24+
3. Navigate to the [quiz][lesson-2-quiz-dir] directory and install the required dependencies.
25+
```bash
26+
cd lesson_02/quiz
27+
npm install --prefix ../../lib/typescript/codedifferently-instructional
28+
npm install
29+
npm start
30+
```
31+
4. Open the [lesson2.ts][lesson-2-file] file located in the [quiz/src/][lesson-2-src-dir] directory.
32+
5. Update the code to provide the correct answers to the given questions.
33+
6. When ready to test, run the following command in the `quiz` sub-directory using the terminal:
34+
```bash
35+
npm run test
36+
```
37+
7. Once all tests pass, submit your work by creating a pull request (PR).
38+
39+
[dev-containers-link]: https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers
40+
[lesson-2-quiz-dir]: quiz/
41+
[lesson-2-file]: quiz/src/lesson2.ts
42+
[lesson-2-src-dir]: quiz/src/
43+
[test-report]: quiz/lesson_02_quiz/build/reports/tests/test/index.html
44+
[spotless-link]: https://github.com/diffplug/spotless

lesson_02/quiz/.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_02/quiz/.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build/

lesson_02/quiz/.prettierignore

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_02/quiz/.prettierrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

lesson_02/quiz/eslint.config.js

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_02/quiz/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)