Gathering detailed insights and metrics for gulp-mocha-tdd
Gathering detailed insights and metrics for gulp-mocha-tdd
npm install gulp-mocha-tdd
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Total Downloads
24,584
Last Day
3
Last Week
20
Last Month
36
Last Year
826
MIT License
3 Stars
83 Commits
2 Forks
2 Watchers
2 Branches
2 Contributors
Updated on Oct 31, 2016
Minified
Minified + Gzipped
Latest Version
2.0.6
Package Id
gulp-mocha-tdd@2.0.6
Size
9.45 kB
NPM Version
2.14.12
Node Version
4.2.4
Cumulative downloads
Total Downloads
Last Day
200%
3
Compared to previous day
Last Week
566.7%
20
Compared to previous week
Last Month
-73.7%
36
Compared to previous month
Last Year
-26.2%
826
Compared to previous year
easy test driven development with gulp and mocha
Run all tests
> gulp test
Run some tests identified by a grep statement
> gulp test --grep foo
Watch for module or unit test changes
> gulp test-watch
Stop on any debugger statements
> gulp test -d (or --debug-brk)
> node-inspector {in another window}
browse to http://127.0.0.1:8080/debug?port=5858
Test modules do not need the top level describe
function (it will be created automatically based on file structure). You can either just have your tests directly in the file (no usage of module.exports
) or you can export a function callback that contains your tests. This callback accepts 2 parameters (targetModule, targetModuleDirectoryPath)
. For example:
var targetModule = require('path/to/target/module');
it('should ...', function() {
expect(targetModule...).to...
});
or
module.exports = function(targetModule, targetBase) {
it('should ...', function() {
expect(targetModule...).to...
});
it('should ...', function() {
expect(require(targetBase + '/targetModuleName')...).to...
});
}
All modules must be within a root directory ("js" by default) and tests can either be in a separate root directory ("tests" by default) or tests can be in a directory relative ("_tests" by default) to the module. Tests can use any naming pattern ("{module name}-test.js" by default).
For example
|-- js
|-- _tests
|-- foo-test.js
|-- foo.js
or
|-- lib
|-- foo.js
|-- tests
|-- foo.spec.js
See Options below for available configuration
Any files within the test directories prefixed with _
will be ignored for testing allowing for utility modules.
The pipe
option (array of gulp stream handlers) can be used to perform additional transformations. The
following gulpfile can be used to support React JSX
var gulp = require('gulp');
var react = require('gulp-react');
var gulpMochaTDD = require('gulp-mocha-tdd');
gulpMochaTDD(gulp, {
pipe: [react({ harmony: true })]
});
Install dependencies
npm install --save-dev mocha
npm install --save-dev gulp
npm install --save-dev gulp-mocha-tdd
Inject the test
task in gulpfile.js
var gulp = require('gulp');
var gulpMochaTDD = require('gulp-mocha-tdd');
gulpMochaTDD(gulp, {
// add options here
});
Add .test
to your .gitignore
file
See Options
section above for details but here is a quick example to include coverage reports in your tests
var gulp = require('gulp');
var gulpMochaTDD = require('gulp-mocha-tdd');
gulpMochaTDD(gulp, {
istanbul: {
dir: './coverage',
reporters: [ 'lcov', 'text' ],
reportOpts: { dir: './coverage' }
}
});
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 1/29 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-03-10
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More