Skip to content

codefellows-javascript-401d17/01-node_ecosystem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

CF 01: Node Ecosystem

Submission Instructions

  • 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 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

Resources

Requirements

Configuration

  • include the following:
    • README.md - contains documentation about your lab
    • .gitignore - contains a robust .gitignore file
    • .eslintrc - contains the provided .eslintrc file
    • .eslintignore - contains the provided .eslintignore file
    • lib/ - should contain your modules
    • test/ - should contain your unit tests

Feature Tasks

  • create a node.js module (greet.js) that exports a single function
    • the greet function should have a single parameter that should expect a string as it's input
    • 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 node.js module named arithmetic.js
    • this module should have add and sub methods
    • the add method should contain 2 parameters
      • these parameters should be numbers and the method should return the sum of the 2 numbers
    • the sub method should contain 2 parameters
      • these parameters should be numbers and the method should return the first number minus the second number
  • decide on the expected behavior for non-number inputs

Testing

  • write a test the expects the greet module to return "hello world!"
    • this should happen when invoked with "world!" as a parameter
  • write a test for the add and subtract methods on the arithmetic module
    • this should ensure that your functions work with number inputs

Documentation

  • write a description of your project (this should be in your README.md file)
BONUS 1pt
  • write a test that expects the greet module to return null when you use non string values
  • write a test that ensures the functions work as expected with non number inputs

Rubric

  • 2pts configuration
  • 3pts feature tasks
  • 3pts tests
  • 2pts documentation

About

Lab 01 - Node Ecosystem

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published