-
-
Notifications
You must be signed in to change notification settings - Fork 11
feat: add basic express workshop #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
ShaunSHamilton
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some notes below.
I will commit a fix to these.
learn-express-by-building-a-random-joke-app/freecodecamp.conf.json
Outdated
Show resolved
Hide resolved
ShaunSHamilton
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have just gone through the first few lessons with mostly API and pedagogy suggestions; I have not inspected the content much.
Main points:
a) Only test what the learning outcome needs - do not make the tests too specific
b) Layout and construct the lessons in such a way you can write more integration tests - use Tower or Babeliser as a last resort
It is common to use more of Babeliser during the first few lessons getting the Camper to set things up. After that, tests more similar to this should be common:
- https://github.com/freeCodeCamp/solana-curriculum/blob/main/curriculum/locales/english/build-a-university-certification-nft.md#--tests--
- https://github.com/freeCodeCamp/web3-curriculum/blob/main/curriculum/locales/english/build-a-peer-to-peer-network.md
- https://github.com/freeCodeCamp/web3-curriculum/blob/main/curriculum/locales/english/build-a-web3-client-side-package-for-your-dapp.md
- https://github.com/freeCodeCamp/web3-curriculum/blob/main/curriculum/locales/english/learn-intermediate-rust-by-building-a-blockchain.md
- I include this one, because the Nodejs tests had to be smart to work on testing Rust without using regex. I wrote actual integration tests in Rust, then used the Nodejs tests to call them.
curriculum/locales/english/learn-express-by-building-a-random-joke-app.md
Outdated
Show resolved
Hide resolved
curriculum/locales/english/learn-express-by-building-a-random-joke-app.md
Outdated
Show resolved
Hide resolved
curriculum/locales/english/learn-express-by-building-a-random-joke-app.md
Outdated
Show resolved
Hide resolved
curriculum/locales/english/learn-express-by-building-a-random-joke-app.md
Show resolved
Hide resolved
curriculum/locales/english/learn-express-by-building-a-random-joke-app.md
Outdated
Show resolved
Hide resolved
| const file = await __helpers.getFile("learn-express-by-building-a-random-joke-app", "server.js"); | ||
| const code = new __helpers.Tower(file); | ||
| const expressVar = code.getVariable("express"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you find yourself doing the same thing repetedly in tests, move this to one of the before hooks. E.g. https://github.com/freeCodeCamp/solana-curriculum/blob/main/curriculum/locales/english/build-a-university-certification-nft.md#--before-all--
curriculum/locales/english/learn-express-by-building-a-random-joke-app.md
Outdated
Show resolved
Hide resolved
| const randomJokeVar = handlerTower.getVariable("randomJoke"); | ||
| assert.exists(randomJokeVar); | ||
|
|
||
| assert.match(randomJokeVar.compact, /(const|let|var)\s+randomJoke\s*=\s*jokes\[Math\.floor\(Math\.random\(\)\*jokes\.length\)\];?/); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test should not check the code like this. Again, test what the lesson aims to teach - not a specific solution.
There are too many permutations of this kind of solution.
Checklist:
Update index.md)Closes freeCodeCamp/CurriculumExpansion#1139