Giter VIP home page Giter VIP logo

401-lab-01's Introduction

LAB: Node Ecosystem

Before you begin

Refer to Getting Started in the lab submission instructions for complete setup, configuration, deployment, and submission instructions.

Getting Started

In the startr_code folder, there is a partial implementation of a "validator" module

In the root of that folder, you'll find a file called index.js that wires in the validator module and attempts to run functions imported from it.

In the __tests__ folder, you'll find a file called validator.test.js that wires in the validator module, sets up some testing (optimistically) but contains no test code

Requirements

Developer Implementation

USE TDD Practices

Write an object validation module that exports a "validate" method that can, based on the inputs, validate whether or not an entity is satisfactory.

Things we want to be able to validate

  • Is the entity itself the right type (array, object, function etc)

  • All all "required" properties present and do they have values?

    • Input needs to be an object
    • Rules needs to be an object too that defines the required properties
    • and ethe expected values
  • For any property that specifies a type, does the value match that type?

  • Recommended approach:

Testing

Validation Module

  • Test each method for proper/improper use (required params)
  • Validate that validation is reliable
  • Validate proper error conditions/returns

Software Engineering Note! Externalizing type checking and argument validation is a good exercise in refactoring code


End User Implementation

  • Use the index.js file to validate objects using the imported functions from the module
  • console.log() the return values

Assignemnt Submission Instructions

Refer to the the lab submission instructions for the complete lab submission process and expectations

401-lab-01's People

Contributors

hierichere avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.