💡 Also available: shared .NET version · Java/Spring Boot version · Angular version · Kotlin version · Swift version
Duration: 15-20 minutes
Learning Objectives:
- Use Copilot to expand plain JavaScript test coverage
- Add helpful plain-language comments without over-documenting
- Update a small README accurately
- Write simple Conventional Commit messages
- Draft a clear pull request description for a lightweight change set
This lab focuses on the finishing work that often gets skipped when people are in a hurry:
- Testing - add coverage around the code you changed
- Documentation - make the code and README easier for the next person to understand
- Workflow - describe your changes clearly in commits and pull requests
For this track, the workflow stays lightweight:
- code lives in
src-javascript/task-manager/task.js - tests live in
src-javascript/task-manager/task.test.js - the track README lives in
src-javascript/task-manager/README.md - validation runs with
node --test
- ✅ Labs 1-3 are complete, or you have made equivalent JavaScript-track changes
- ✅
task.js,task.test.js, andREADME.mdexist insrc-javascript/task-manager/ - ✅ Baseline verification completed:
cd src-javascript/task-manager
node --testBy now your task manager probably has more logic than the original three happy-path tests covered.
This is a good moment to let Copilot help you find missing cases.
Open src-javascript/task-manager/task.js, select one function, and try:
/tests
If you prefer regular chat, use a prompt like:
Add node:test coverage for src-javascript/task-manager/task.js.
Focus on validation errors, copy-returning behavior, and allowed status or priority rules.
Use node:assert/strict.
Strong additions usually cover things like:
- blank titles are rejected
- missing descriptions are rejected if you added that rule
- invalid priorities are rejected
- invalid status changes are rejected
updateStatusreturns a new object instead of changing the originalupdateDetailsreturns a new object instead of changing the original
cd src-javascript/task-manager
node --testIf the tests pass, your code has a stronger safety net.
For this track, good documentation does not mean formal JSDoc everywhere. It means short, useful explanations in plain language.
Try this prompt:
Review src-javascript/task-manager/task.js and suggest a few short plain-language comments that explain the non-obvious business rules.
Do not add noisy comments that only repeat the code.
Good comment locations might include:
- why tasks are kept as plain objects in this track
- why certain status changes are rejected
- why helper functions exist after refactoring
A useful comment might look like:
// Keep this list small and explicit so invalid status values fail fast.
const TASK_STATUSES = ['Todo', 'InProgress', 'Done', 'Cancelled'];Avoid comments like this:
// This function updates the task.
function updateDetails(...) {That kind of comment does not add any real help.
Open src-javascript/task-manager/README.md and ask Copilot:
Suggest a small README update for src-javascript/task-manager/README.md.
Explain what the task manager demonstrates, how to run the tests with node --test, and which file contains the main task functions.
Keep it concise and accurate.
This is especially useful after Labs 1-3 changed the behavior beyond the original scaffold.
A typical JavaScript-track change set might include:
git add src-javascript/task-manager/task.js
git add src-javascript/task-manager/task.test.js
git add src-javascript/task-manager/README.mdTry:
Write a Conventional Commit message for the plain JavaScript workshop track.
The change added task validation, priority support, and more node:test coverage.
Include a short subject and a helpful body.
A good result might look like this:
feat(javascript): add task validation and priority rules
- validate task titles and priority values
- keep task logic in one plain JavaScript file
- expand node:test coverage for happy-path and error cases
- update the task-manager README for workshop participants
If Lab 3 created a separate refactor commit, try:
Write a Conventional Commit message for a plain JavaScript refactor that split one large function into smaller helper functions without changing behavior.
Example result:
refactor(javascript): split task update logic into helpers
- extract validation helpers for clearer intent
- separate validation from update behavior
- preserve existing behavior with node:test coverage
Prompt Copilot Chat:
@workspace Draft a pull request description for the plain JavaScript task-manager track.
Include:
- summary of behavior changes
- testing performed
- documentation updates
- a short reviewer checklist
Use Markdown.
## Summary
This PR expands the plain JavaScript task-manager workshop track by adding validation,
priority support, and a small refactor that keeps the code readable without introducing
extra layers or tooling.
## Testing Performed
```bash
cd src-javascript/task-manager
node --test
```
## Reviewer Checklist
- [ ] task behavior still lives in one JavaScript file
- [ ] tests cover both success and error paths
- [ ] comments explain why, not just what
- [ ] README matches the actual commands and filesReview the output before using it. Copilot is a drafting partner, not the final approver.
- Copilot can generate a strong first draft of tests
- you still need to review the edge cases and assertions
node --testgives you a fast, dependency-free way to validate changes
- comments should explain the reason behind a rule
- README updates should stay short and accurate
- plain-language documentation fits this track better than formal JSDoc everywhere
- Conventional Commits make change history easier to scan
- a short PR summary helps reviewers understand the goal quickly
- a reviewer checklist reduces back-and-forth
Prompt Copilot to look for one validation case your tests still do not cover.
Take one generated comment and rewrite it so it explains more with fewer words.
Ask Copilot to summarize the JavaScript track changes in 3-5 bullets for workshop release notes.
You've completed this lab successfully when:
- ✅
task.test.jshas stronger coverage than the starter scaffold - ✅
task.jshas a few helpful plain-language comments where they add value - ✅
src-javascript/task-manager/README.mdaccurately reflects the track - ✅ you can produce a Conventional Commit message for your work
- ✅ you have a clear PR description draft with testing notes and a checklist
- ✅
node --teststill passes
Problem: the tests only check that something exists
Solution: ask for specific behavior, error cases, and checks that the original object stays unchanged.
Problem: the file is full of comments that repeat the code
Solution: keep only comments that explain a rule, decision, or non-obvious reason.
Problem: the generated text mentions files or commands that do not exist
Solution: compare every line against the actual track: task.js, task.test.js, README.md, and node --test.
Problem: Copilot suggested something like update javascript files
Solution: tell Copilot exactly what changed and ask for a Conventional Commit format.
After Lab 4, the JavaScript track should leave you with a full lightweight workflow:
- write tests first
- turn plain-language requirements into code
- refactor for readability
- document the important decisions
- prepare clear commit and PR text
That is the same overall workshop journey as the other tracks, translated into the simplest possible technical setup.