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

testcafe-reporter-minimal

Package Overview
Dependencies
Maintainers
6
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

testcafe-reporter-minimal - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

189

lib/index.js

@@ -1,102 +0,93 @@

'use strict';
"use strict";
Object.defineProperty(exports, '__esModule', {
value: true
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = _default;
var NEW_LINE = '\n ';
exports['default'] = function () {
return {
noColors: false,
spaceLeft: 0,
errDescriptors: [],
currentFixtureName: null,
testCount: 0,
skipped: 0,
reportTaskStart: function reportTaskStart(startTime, userAgents, testCount) {
var _this = this;
this.testCount = testCount;
this.setIndent(1).useWordWrap(true).write(this.chalk.bold('Running tests in:')).newline();
userAgents.forEach(function (ua) {
_this.write('- ' + _this.chalk.blue(ua)).newline();
});
},
reportFixtureStart: function reportFixtureStart(name) {
this.currentFixtureName = name;
},
reportTestDone: function reportTestDone(name, testRunInfo) {
var _this2 = this;
var hasErr = !!testRunInfo.errs.length;
var symbol = null;
if (testRunInfo.skipped) {
this.skipped++;
symbol = this.chalk.cyan('-');
} else if (hasErr) symbol = this.chalk.red('!');else symbol = '.';
if (this.spaceLeft - 1 < 0) {
this.spaceLeft = this.viewportWidth - NEW_LINE.length - 1;
this.write(NEW_LINE);
} else this.spaceLeft--;
this.write(symbol);
if (hasErr) {
this.errDescriptors = this.errDescriptors.concat(testRunInfo.errs.map(function (err) {
return {
err: err,
testName: name,
fixtureName: _this2.currentFixtureName
};
}));
}
},
_renderErrors: function _renderErrors() {
var _this3 = this;
this.newline();
this.errDescriptors.forEach(function (errDescriptor) {
var title = _this3.chalk.bold.red(_this3.symbols.err) + ' ' + errDescriptor.fixtureName + ' - ' + errDescriptor.testName;
_this3.setIndent(1).useWordWrap(true).newline().write(title).newline().newline().setIndent(3).write(_this3.formatError(errDescriptor.err)).newline().newline();
});
},
_renderWarnings: function _renderWarnings(warnings) {
var _this4 = this;
this.newline().setIndent(1).write(this.chalk.bold.yellow('Warnings (' + warnings.length + '):')).newline();
warnings.forEach(function (msg) {
_this4.setIndent(1).write(_this4.chalk.bold.yellow('--')).newline().setIndent(2).write(msg).newline();
});
},
reportTaskDone: function reportTaskDone(endTime, passed, warnings) {
var allPassed = !this.errDescriptors.length;
var footer = allPassed ? this.chalk.bold.green(this.testCount + ' passed') : this.chalk.bold.red(this.testCount - passed + '/' + this.testCount + ' failed');
if (!allPassed) this._renderErrors();else this.newline();
this.setIndent(1).newline().write(footer).newline();
if (this.skipped > 0) {
this.write(this.chalk.cyan(this.skipped + ' skipped')).newline();
}
if (warnings.length) this._renderWarnings(warnings);
}
};
};
module.exports = exports['default'];
function _default() {
return {
noColors: false,
spaceLeft: 0,
errDescriptors: [],
currentFixtureName: null,
testCount: 0,
skipped: 0,
reportTaskStart: function reportTaskStart(startTime, userAgents, testCount) {
var _this = this;
this.testCount = testCount;
var writeData = {
startTime: startTime,
userAgents: userAgents,
testCount: testCount
};
this.setIndent(1).useWordWrap(true).write(this.chalk.bold('Running tests in:'), writeData).newline();
userAgents.forEach(function (ua) {
_this.write("- ".concat(_this.chalk.blue(ua)), writeData).newline();
});
},
reportFixtureStart: function reportFixtureStart(name) {
this.currentFixtureName = name;
},
reportTestDone: function reportTestDone(name, testRunInfo, meta) {
var _this2 = this;
var hasErr = !!testRunInfo.errs.length;
var symbol = null;
if (testRunInfo.skipped) {
this.skipped++;
symbol = this.chalk.cyan('-');
} else if (hasErr) symbol = this.chalk.red('!');else symbol = '.';
var writeData = {
name: name,
testRunInfo: testRunInfo,
meta: meta
};
if (this.spaceLeft - 1 < 0) {
this.spaceLeft = this.viewportWidth - NEW_LINE.length - 1;
this.write(NEW_LINE, writeData);
} else this.spaceLeft--;
this.write(symbol, writeData);
if (hasErr) {
this.errDescriptors = this.errDescriptors.concat(testRunInfo.errs.map(function (err) {
return {
err: err,
testName: name,
fixtureName: _this2.currentFixtureName
};
}));
}
},
_renderErrors: function _renderErrors(writeData) {
var _this3 = this;
this.newline();
this.errDescriptors.forEach(function (errDescriptor) {
var title = "".concat(_this3.chalk.bold.red(_this3.symbols.err), " ").concat(errDescriptor.fixtureName, " - ").concat(errDescriptor.testName);
_this3.setIndent(1).useWordWrap(true).newline().write(title, writeData).newline().newline().setIndent(3).write(_this3.formatError(errDescriptor.err), writeData).newline().newline();
});
},
_renderWarnings: function _renderWarnings(warnings, writeData) {
var _this4 = this;
this.newline().setIndent(1).write(this.chalk.bold.yellow("Warnings (".concat(warnings.length, "):")), writeData).newline();
warnings.forEach(function (msg) {
_this4.setIndent(1).write(_this4.chalk.bold.yellow('--'), writeData).newline().setIndent(2).write(msg, writeData).newline();
});
},
reportTaskDone: function reportTaskDone(endTime, passed, warnings, result) {
var allPassed = !this.errDescriptors.length;
var footer = allPassed ? this.chalk.bold.green("".concat(this.testCount, " passed")) : this.chalk.bold.red("".concat(this.testCount - passed, "/").concat(this.testCount, " failed"));
var writeData = {
endTime: endTime,
passed: passed,
warnings: warnings,
result: result
};
if (!allPassed) this._renderErrors(writeData);else this.newline();
this.setIndent(1).newline().write(footer, writeData).newline();
if (this.skipped > 0) {
this.write(this.chalk.cyan("".concat(this.skipped, " skipped")), writeData).newline();
}
if (warnings.length) this._renderWarnings(warnings, writeData);
}
};
}
module.exports = exports.default;
{
"name": "testcafe-reporter-minimal",
"version": "2.1.0",
"version": "2.2.0",
"description": "Minimal TestCafe reporter plugin.",

@@ -16,2 +16,3 @@ "repository": "https://github.com/DevExpress/testcafe-reporter-minimal",

"test": "gulp test",
"build": "gulp build",
"publish-please": "publish-please",

@@ -28,15 +29,18 @@ "prepublish": "publish-please guard"

"devDependencies": {
"babel-eslint": "^4.0.10",
"@babel/core": "^7.21.3",
"@babel/preset-env": "^7.20.2",
"@babel/eslint-parser": "^7.21.3",
"babel-plugin-add-module-exports": "^1.0.4",
"callsite-record": "^3.2.0",
"del": "^1.2.0",
"gulp": "^3.9.0",
"gulp-babel": "^5.2.1",
"gulp-eslint": "^1.1.1",
"gulp-mocha": "^2.2.0",
"normalize-newline": "^1.0.2",
"gulp": "^4.0.2",
"gulp-babel": "^8.0.0",
"gulp-eslint": "^6.0.0",
"gulp-mocha": "^8.0.0",
"normalize-newline": "^3.0.0",
"os-family": "^1.0.0",
"publish-please": "^2.1.4",
"publish-please": "^5.5.2",
"read-file-relative": "^1.2.0",
"testcafe": "0.9.0"
"testcafe": "2.4.0"
}
}

@@ -12,2 +12,6 @@ # testcafe-reporter-minimal

This reporter is shipped with TestCafe by default. In most cases, you won't need to install it separately.
However, if you need to install this reporter, you can use the following command.
```

@@ -14,0 +18,0 @@ npm install testcafe-reporter-minimal

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