Code Monkey home page Code Monkey logo

nodejs-mocha-chai's Introduction

Quality Assurance with Chai

This project reviews Quality Assurance with Chai lessons. Instructions for completing these lessons start at https://www.freecodecamp.org/learn/quality-assurance/quality-assurance-and-testing-with-chai/

Tasks to complete for unit tests

To pass these tests, complete assertion syntax in file ./tests/1_unit-tests.js.

Tasks to complete for functional tests

To pass these tasks, complete functions in file ./tests/2_functional-tests.js

Tests Output

npm start

[email protected] start /home/runner/boilerplate-mochachai node server.js

Listening on port 3000

Running Tests...

Unit Tests

Basic Assertions

  ✔ #isNull, #isNotNull

  ✔ #isDefined, #isUndefined

  ✔ #isOk, #isNotOk

  ✔ #isTrue, #isNotTrue

Equality

  ✔ #equal, #notEqual

  ✔ #strictEqual, #notStrictEqual

  ✔ #deepEqual, #notDeepEqual

Comparisons

  ✔ #isAbove, #isAtMost

  ✔ #isBelow, #isAtLeast

  ✔ #approximately

Arrays

  ✔ #isArray, #isNotArray

  ✔ Array #include, #notInclude

Strings

  ✔ #isString, #isNotString

  ✔ String #include, #notInclude

  ✔ #match, #notMatch

Objects

  ✔ #property, #notProperty

  ✔ #typeOf, #notTypeOf

  ✔ #instanceOf, #notInstanceOf

Functional Tests

Integration tests with chai-http

  ✔ Test GET /hello with no name

  ✔ Test GET /hello with your name

  ✔ Send {surname: "Colombo"}

  ✔ Send {surname: "da Verrazzano"}

Functional Tests with Zombie.js

Headless browser

  ✔ should have a working "site" property

"Famous Italian Explorers" form

  ✔ Submit the surname "Colombo" in the HTML form (256ms)

  ✔ Submit the surname "Vespucci" in the HTML form (358ms)

25 passing (3s)

nodejs-mocha-chai's People

Contributors

aesclever avatar

Watchers

James Cloos avatar Mark V Nguyen 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.