Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grunt-mocha-chai-sinon

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-mocha-chai-sinon

MochaJS + ChaiJS + SinonJS Test Runner

  • 0.0.8
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13
increased by333.33%
Maintainers
1
Weekly downloads
 
Created
Source

grunt-mocha-chai-sinon

Simple test runner for GruntJS using MochaJS as test framework, ChaiJS as assertion library for BDD and TDD and SinonJS as spyes/stubs/mocks utility library.

Gruntfile Example

// Gruntfile.js
module.exports = function(grunt) {
    
    // configure tasks
    grunt.initConfig({
        'mocha-chai-sinon': {
            build: {
                src: ['./specs/**/*.spec.js'],
	    	    options: {
        		    ui: 'bdd',
        			reporter: 'spec'
	        	}
        	}
        }
    });
    
    // load required tasks
    grunt.loadNpmTasks("grunt-mocha-chai-sinon");
    
    // register tasks for execution chain
    grunt.registerTask('test', [
		'mocha-chai-sinon'
	]);
};	

Test Coverage

Test coverage support is provided by node-jscoverage while source code is coverage enabled with BlancketJS.

In order to activate test coverage you need to create a new configuration for the mocha-chai-sinon task and name it coverage.
The name matter!

'mocha-chai-sinon': {
    build: {
        src: ['./specs/**/*.spec.js'],
        options: {
            ui: 'bdd',
            reporter: 'spec'
        }
    },
    coverage: {
        src: ['./specs/**/*.spec.js'],
        options: {
            ui: 'bdd',
            reporter: 'html-cov',
            quiet: true,
            filter: '/foo/foo1/',
            captureFile: './coverage.html'
        }
    }
}

By default mocha-chai-sinon add test coverage support to all loaded files who match the /project-folder/src/ path but you can configure it with the coverage.options.filter option.

Keywords

FAQs

Package last updated on 31 Mar 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc