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

cucumber-html-reporter

Package Overview
Dependencies
Maintainers
1
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cucumber-html-reporter - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

9

CHANGELOG.md

@@ -0,1 +1,10 @@

### 0.2.1 (2016-07-12)
#### Enhancements
* Recursively create HTML report directory if does not exists
* Remove outdated chai-fs depedency and use chai-should assertions
* Lighter the background color or Scenario attachments
### 0.2.0 (2016-07-10)

@@ -2,0 +11,0 @@

@@ -8,2 +8,3 @@ 'use strict';

var path = require('path');
var nodeFs = require('node-fs');

@@ -46,2 +47,10 @@ var generateReport = function(options) {

var createReportDirectoryIfNotExists = function() {
if (!fs.existsSync(options.output)) {
nodeFs.mkdirSync(path.dirname(options.output), parseInt('0777', 8), true);
}
};
createReportDirectoryIfNotExists();
var setStats = function(suite) {

@@ -48,0 +57,0 @@ var featureOutput = suite.features;

11

package.json
{
"name": "cucumber-html-reporter",
"version": "0.2.0",
"version": "0.2.1",
"description": "Generates Cucumber HTML reports in three different themes",

@@ -17,3 +17,4 @@ "main": "index.js",

"scripts": {
"test": "npm run features",
"test": "npm run features && npm run clean",
"clean": "rm -r test/report/*.html test/report/*.json test/report/screenshot",
"features": "node node_modules/cucumber/bin/cucumber test/features/ -f json:test/report/cucumber_report.json"

@@ -42,9 +43,9 @@ },

"dependencies": {
"chai": "^1.10.0",
"chai-fs": "^0.1.0",
"chai": "^3.5.0",
"commondir": "^1.0.1",
"js-base64": "^2.1.9",
"jsonfile": "^2.3.1",
"lodash": "^4.13.1"
"lodash": "^4.13.1",
"node-fs": "^0.1.7"
}
}
'use strict';
var chai = require('chai');
chai.use(require('chai-fs'));
var expect = chai.expect;
var fs = require('fs');
should = chai.should();
var path = require('path');
module.exports = function assertHtmlReports() {
module.exports = function assertHtmlReports(outputDirectory) {
var bootstrapHtmlFile = 'test/report/cucumber_report_bootstrap.html';
var foundationHtmlFile = 'test/report/cucumber_report_foundation.html';
var simpleHtmlFile = 'test/report/cucumber_report_simple.html';
function isReportExists(report) {
try {
return fs.statSync(report).isFile();
} catch (e) {
return false
}
}
expect(bootstrapHtmlFile).to.be.a.path('Bootstrap HTML report was not created');
expect(foundationHtmlFile).to.be.a.path('Foundation HTML report was not created');
expect(simpleHtmlFile).to.be.a.path('Simple HTML report was not created');
var bootstrapHtmlFile = path.join(outputDirectory, 'cucumber_report_bootstrap.html');
var foundationHtmlFile = path.join(outputDirectory, 'cucumber_report_foundation.html');
var simpleHtmlFile = path.join(outputDirectory, 'cucumber_report_simple.html');
isReportExists(bootstrapHtmlFile).should.be.equal(true, 'bootstrapHtmlFile file \'' + bootstrapHtmlFile + '\' does not exist');
isReportExists(foundationHtmlFile).should.be.equal(true, 'foundationHtmlFile file \'' + foundationHtmlFile + '\' does not exist');
isReportExists(simpleHtmlFile).should.be.equal(true, 'simpleHtmlFile file \'' + simpleHtmlFile + '\' does not exist');
};

@@ -5,2 +5,3 @@ 'use strict';

var assertHtmlReports = require('../../assert/assertHtmlReports');
var path = require('path');

@@ -22,2 +23,4 @@ var hooks = function() {

var outputDirectory = 'test/report/';
function getOptions(theme) {

@@ -27,3 +30,3 @@ return {

jsonFile: 'test/report/cucumber_report.json',
output: 'test/report/cucumber_report_' + theme + '.html',
output: path.join(outputDirectory, 'cucumber_report_' + theme + '.html'),
reportSuiteAsScenarios: true

@@ -44,3 +47,3 @@ };

//assert reports
assertHtmlReports();
assertHtmlReports(outputDirectory);

@@ -47,0 +50,0 @@ callback();

@@ -47,3 +47,3 @@ 'use strict';

this.scenario.attach(JSON.stringify(myJsonObject, undefined, 2));
callback();

@@ -50,0 +50,0 @@ });

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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