- Read this document entirely and estimate how long this assignment will take.
- 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-susan - Submit on canvas a question and observation,your original estimate, how long you spent, and a link to your pull request
Configure the root of your repository with the following files and directories. Thoughtfully name and organize any additional configuration or module files.
- README.md - contains your documentation
- .gitignore - contains a robust
.gitignorefile - .eslintrc.json - contains the course linter configuration
- .eslintignore - contains the course linter ignore configuration
- lib/ - contains module definitions
- test/ - contains unit tests
- Write a test that expects the greet module to return
nullwhen you supply non-string values - Write a test the expects the greet module to return
'hello world'- This should happen when invoked with
'world'as the first argument
- This should happen when invoked with
- Test each method for proper use (invoked with number arguments)
- Test each method for inproper use (invoked with one or more non-number arguments)
Create a NodeJS module in the lib directory named greet.js. This module should export a single function.
- The
greetfunction should have a single parameter (arity of one) that should expect a string as it's input - The
greetfunction should return the input name, concatenated with "hello ": eg. ("hello susan") - The
greetfunction should returnnullif the input is not a string
Create a NodeJS module in the lib directory named arithmetic.js. This module exports an object and should have add and sub methods that implement addition and subtraction.
- The
addmethod should have a 2 parameters (airty of two)ifeither argument is a non-number the function should returnnullelsereturn the sum of the 2 numbers
- The
submethod should have 2 parameters (airty of two)ifeither argument is a non-number the function should returnnullelsereturn the second parameter subtracted from the first parameter
In your README.md file, describe the exported values of each module defined in your lib directory. Every function description should include it's airty (expected number of parameters), the expected data for each parameter (data-type and limitations), and the expected output behavior (for both valid and invalid use). Feel free to include any additional information that you would like.