GithubHelp home page GithubHelp logo

tests_mocha_chai's Introduction

It's a npm project created to check the basic utilities of Chaijs module to create Unit Tests in a project developed in NodeJS

CHAI:

Chai is a BDD / TDD assertion library for node and the browser that can be delightfully paired with any javascript testing framework.
Chaijs page: http://chaijs.com/

INTERFACES:

Chai has several interfaces that allow the developer to choose the most comfortable. The chain-capable BDD styles provide an expressive language & readable style, while the TDD assert style provides a more classical feel:

Should:

chai.should();
foo.should.be.a('string');
foo.should.equal('bar');
foo.should.have.lengthOf(3);
tea.should.have.property('flavors').with.lengthOf(3);

Expect:

var expect = chai.expect;
expect(foo).to.be.a('string');
expect(foo).to.equal('bar');
expect(foo).to.have.lengthOf(3);
expect(tea).to.have.property('flavors').with.lengthOf(3);

Assert:

var assert = chai.assert;
assert.typeOf(foo, 'string');
assert.equal(foo, 'bar');
assert.lengthOf(foo, 3)
assert.property(tea, 'flavors');
assert.lengthOf(tea.flavors, 3);

HOW TO START:

Clone the repository:

git clone https://github.com/RMarquezD/tests_mocha_cha

Install project Dependences:

npm install

Execute Tests:

Using npm:

npm test

Using Mocha:

To execute all tests. From proyect path mocha
To execute a test file. mocha testfile.js

tests_mocha_chai's People

Contributors

rmarquezd avatar

Stargazers

Gustavo Mena avatar Alejandro Gutierrez Barcenilla avatar Raúl Novelo avatar  avatar

Watchers

 avatar  avatar Alejandro Gutierrez Barcenilla 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.