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

grunt-wendy

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-wendy - npm Package Compare versions

Comparing version 0.0.6 to 1.0.0

33

Gruntfile.js

@@ -8,4 +8,6 @@ 'use strict';

test: {
series: {},
parallel: {},
series: {}
parallelFiltered: {},
nofail: {},
},

@@ -36,6 +38,25 @@

},
dubious: {
parallelFiltered: {
options: {
async: 'each',
cli: ['--foo=bar'],
formatterOptions: {
whitespace: true,
filter: /(Test file:)|(tests executed)/
}
},
files: { src: ['test/a*.js'] }
},
dubious: { // don't fail
options: {
fail: [],
warn: ['dubious', 'failed']
},
files: { src: ['test/c*.js'] }
},
fail: {
fail: { // don't fail
options: {
fail: [],
warn: ['dubious', 'failed']
},
files: { src: ['test/d*.js'] }

@@ -59,2 +80,8 @@ }

}
else if (this.target === 'parallelFiltered') {
grunt.task.run(['wendy:parallelFiltered']);
}
else if (this.target === 'nofail') {
grunt.task.run(['wendy:dubious', 'wendy:fail']);
}
});

@@ -61,0 +88,0 @@

2

package.json
{
"name": "grunt-wendy",
"description": "CasperJS test runner",
"version": "0.0.6",
"version": "1.0.0",
"homepage": "https://github.com/davidosomething/grunt-wendy",

@@ -6,0 +6,0 @@ "author": {

@@ -10,3 +10,3 @@ # grunt-wendy

[![Development Dependency Status][davidDevBadge]][davidDevLink]
<br>[![npm Badge][nodeiBadge]]([nodeiLink])
<br>[![npm Badge][nodeiBadge]][nodeiLink]

@@ -61,6 +61,9 @@ This was originally a fork of [ronaldlokers/grunt-casperjs] but with more

async: 'eachSeries',
clean: true,
cli: [],
runner: 'test',
formatter: formatter, // function in tasks/lib/formatter.js
formatterOptions: {
whitespace: true,
filter: null
},
fail: ['failed'],

@@ -92,19 +95,2 @@ warn: ['dubious', 'skipped']

#### Clean
This task tries to clean up the casper output a bit and outputs aggregated
test results when multiple suites (multiple files) are run in a single task.
You can set the option to false to disable it. **The default formatter uses this
option.**
```javascript
wendy: {
options: {
clean: false
},
tests: ['tests/e2e/**/*.js']
}
```
#### CLI Options

@@ -160,2 +146,27 @@

#### Formatter Options
This task tries to clean up the casper output whitespace and outputs aggregated
test results when multiple suites (multiple files) are run in a single task.
**If you change the `formatter` this option may not apply.**
* `whitespace`: boolean -- true to clean up casper whitespace
* `filter`: regex -- anything that matches this filter will not be output
```javascript
wendy: {
options: {
formatterOptions: {
// don't try to clean up whitespace
whitespace: false,
// don't output lines saying 'Test file:' name and the suite summary
filter: /(Test file:)|(tests executed)/
}
},
tests: ['tests/e2e/**/*.js']
}
```
#### Grunt exit status

@@ -188,2 +199,5 @@

## CHANGELOG
* 1.0.0
* Change `clean` to `formatterOptions.whitespace`
* Add `filter` to formatterOptions
* 0.0.6

@@ -190,0 +204,0 @@ * Add `fail` and `warn` options

@@ -1,11 +0,32 @@

module.exports = function (grunt, options, data) {
if (options.clean) {
if (data.indexOf('Test file:') > -1) {
process.stdout.write(grunt.util.linefeed);
/**
* formatCasperOutput
*
* @param {object} grunt
* @param {object} options from grunt task
* @param {string} data casper output line
*/
module.exports = function formatCasperOutput(grunt, options, data) {
if (options.formatterOptions) {
// should this line be filtered out?
if (options.formatterOptions.filter) {
if (options.formatterOptions.filter.test(data)) {
return;
}
}
process.stdout.write(' ' + data);
// format whitespace?
if (options.formatterOptions.whitespace) {
if (data.indexOf('Test file:') > -1) {
process.stdout.write(grunt.util.linefeed);
}
process.stdout.write(' ' + data);
return;
}
}
else {
process.stdout.write(data);
}
// default -- straight output
process.stdout.write(data);
return;
};

@@ -20,8 +20,12 @@ 'use strict';

var done = this.async();
var options = this.options({
async: 'eachSeries',
clean: true,
cli: [],
runner: 'test',
formatter: formatter,
formatterOptions: {
whitespace: true,
filter: null
},
fail: ['failed'],

@@ -28,0 +32,0 @@ warn: ['dubious', 'skipped'],

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