GithubHelp home page GithubHelp logo

republicvirgo / super-mocha-demo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mhaidarhanif/super-mocha-demo

0.0 2.0 0.0 38 KB

:snowflake: Super Mocha test demo with Travis CI

JavaScript 100.00%

super-mocha-demo's Introduction

Unit Testing and TDD Demo

A very simple unit testing and TDD demo with Mocha and Chai. We are just making some basic math operations.

Running

npm start    # node src
npm run dev  # nodemon src

Testing

npm test              # run all tests (src/**/*.test.js)
npm run test:watch    # run test with watch (for TDD/BDD)
npm run test:awesome  # run test with awesome report watch (for TDD/BDD)
npm run test:awesome:live  # run test with awesome report then live-server
npm run test:nyan     # run test with nyan report
npm run test:custom   # run test with custom report

CI

This repo is hooked to Travis CI with .travis.yml config. Check out https://travis-ci.org/mhaidarh/super-mocha-demo.

Sample Output

Spec Report

❯ npm test

> [email protected] test /Users/mhaidarh/All/repo/hacktiv8/phase-2-codes/week-7/testing-everything
> mocha src/**/*.test.js

  test some basic assertions
    math object and function
      ✓ assert to be object
      ✓ assert to be function
      math.isOdd
        ✓ assert to be true
      math.isEven
        ✓ assert to be true

  test some math functions
    isOdd(): should be an odd number
      ✓ with should
      ✓ with expect
    isEven(): should be an even number
      ✓ with should
      ✓ with expect
    isFactorialWith(): expect to be the factorial
      ✓ with expect

  9 passing (20ms)

Awesome Report

mocha-awesome

super-mocha-demo's People

Contributors

mhaidarhanif avatar

Watchers

James Cloos avatar Dony Putra 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.