- Work in a fork of this repository
- Work in a branch on your fork
- Write all of your code in a directory named
lab-
+<your name>
e.g.lab-duncan
- Submit a pull request to this repository
- Submit a link to your pull request on canvas
- Submit a question, observation, and how long you spent on canvas
- Students will be able to set up a directory for creating an npm package
- Students will be able to create and use CommonJS modules
- Students will be able to write synchronous unit tests
Your lab directory must include
- README.md -- with a documentation about your lab
- .gitignore -- with a robust gitignore
- .eslintrc -- with the class .eslintrc file
- .eslintignore -- with the class .eslintignore
- .package.json -- with all dependencies and dev-dependencies
- lib/ -- a lib direcotry for holding your modules
- test/ -- a test directory for holding your unit tests
- Create a nodejs module named greet.js that exports a single function
- The greet function should have a single parameter name that should expect a string
- The greet function should return the input name concatenated with "Hello, "
- The greet function should return null if the input is not a string
- Create a nodejs module named arithmetic
- The arithmetic.js module should have
add
andsub
methods add
should have to params that should expect a number, it should return the sum of the to numberssub
should have to params that should expect a number, it should return the first argument minus the second argument- decide on an expected behavior for non number inputs
- Write a test the expects the greet module to return "Hello, world!" when invoked with "world!" as a parameter
- Write a test that expects the greet module to return null when you use non string values
- Write test for the
add
andsubtract
methods on the arithmetic module - Write a test that ensures the functions work as you expect with number inputs
- Write a test that ensures the functions work as expected with non number inputs
- Write a description of your project in your README.md
- Write a test for the index.js CLI
- 2pts Configuration
- 3pts Feature Tasks
- 3pts Tests
- 2pts Documentation