Skip to content

Instantly share code, notes, and snippets.

@ramingar
Created June 9, 2015 11:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ramingar/4c7d72cc7616198165f7 to your computer and use it in GitHub Desktop.
Save ramingar/4c7d72cc7616198165f7 to your computer and use it in GitHub Desktop.
Run tests - Ejecutar tests en Node.js #node #nodejs #tests #mocha #coverage #istanbul

Instala las herramientas de testing:

npm install --save-dev mocha should istanbul

Crear los tests en /test:

describe ( 'When you run this application in AWS, you', function () {
  it('should have set your region defined as AWS region', function () {
    AWS.config.region.should.equal(awsRegion);
  });
});

Ejecutar los tests:

mocha

Ejecutar la cobertura que te dan los tests:

istanbul cover node_modules/mocha/bin/_mocha -- -R spec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment