New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jasmine-json-stream-reporter

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jasmine-json-stream-reporter - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

2

browser.js

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

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("JasmineJsonStreamReporter",[],e):"object"==typeof exports?exports.JasmineJsonStreamReporter=e():t.JasmineJsonStreamReporter=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=n(1),s=function(){function t(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];r(this,t),this._specResults=[],this._uuid=i.v4(),this.print=e.print||function(){var t;(t=console).log.apply(t,arguments)},this.onComplete=e.onComplete||function(){}}return t.prototype.suiteDone=function(t){t=o({},t,{id:[this._uuid,t.id,"suite"].join(":"),specs:this._specResults}),this.print(JSON.stringify(t)),this._specResults=[]},t.prototype.specDone=function(t){t=o({},t,{id:[this._uuid,t.id,"spec"].join(":")}),this.print(JSON.stringify(t)),this._specResults.push(t)},t.prototype.jasmineDone=function(){this.onComplete.apply(this,arguments)},t}();t.exports=s},function(t,e,n){function r(t,e,n){var r=e&&n||0,o=0;for(e=e||[],t.toLowerCase().replace(/[0-9a-f]{2}/g,function(t){o<16&&(e[r+o++]=c[t])});o<16;)e[r+o++]=0;return e}function o(t,e){var n=e||0,r=u;return r[t[n++]]+r[t[n++]]+r[t[n++]]+r[t[n++]]+"-"+r[t[n++]]+r[t[n++]]+"-"+r[t[n++]]+r[t[n++]]+"-"+r[t[n++]]+r[t[n++]]+"-"+r[t[n++]]+r[t[n++]]+r[t[n++]]+r[t[n++]]+r[t[n++]]+r[t[n++]]}function i(t,e,n){var r=e&&n||0,i=e||[];t=t||{};var s=void 0!==t.clockseq?t.clockseq:v,a=void 0!==t.msecs?t.msecs:(new Date).getTime(),u=void 0!==t.nsecs?t.nsecs:h+1,c=a-d+(u-h)/1e4;if(c<0&&void 0===t.clockseq&&(s=s+1&16383),(c<0||a>d)&&void 0===t.nsecs&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");d=a,h=u,v=s,a+=122192928e5;var p=(1e4*(268435455&a)+u)%4294967296;i[r++]=p>>>24&255,i[r++]=p>>>16&255,i[r++]=p>>>8&255,i[r++]=255&p;var f=a/4294967296*1e4&268435455;i[r++]=f>>>8&255,i[r++]=255&f,i[r++]=f>>>24&15|16,i[r++]=f>>>16&255,i[r++]=s>>>8|128,i[r++]=255&s;for(var m=t.node||l,y=0;y<6;y++)i[r+y]=m[y];return e?e:o(i)}function s(t,e,n){var r=e&&n||0;"string"==typeof t&&(e="binary"==t?new Array(16):null,t=null),t=t||{};var i=t.random||(t.rng||a)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e)for(var s=0;s<16;s++)e[r+s]=i[s];return e||o(i)}for(var a=n(2),u=[],c={},p=0;p<256;p++)u[p]=(p+256).toString(16).substr(1),c[u[p]]=p;var f=a(),l=[1|f[0],f[1],f[2],f[3],f[4],f[5]],v=16383&(f[6]<<8|f[7]),d=0,h=0,m=s;m.v1=i,m.v4=s,m.parse=r,m.unparse=o,t.exports=m},function(t,e){(function(e){var n;if(e.crypto&&crypto.getRandomValues){var r=new Uint8Array(16);n=function(){return crypto.getRandomValues(r),r}}if(!n){var o=new Array(16);n=function(){for(var t,e=0;e<16;e++)0===(3&e)&&(t=4294967296*Math.random()),o[e]=t>>>((3&e)<<3)&255;return o}}t.exports=n}).call(e,function(){return this}())}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("JasmineJsonStreamReporter",[],e):"object"==typeof exports?exports.JasmineJsonStreamReporter=e():t.JasmineJsonStreamReporter=e()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){var r=t.id;return[this.uuid,r,e].filter(Boolean).join(":")}var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},s=r(1),a=function(){function t(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];n(this,t);var r=e.header,o=void 0===r?t.defaultHeader:r;this.specResults=[],this.uuid=s.v4(),this.print=e.print||function(){var t;(t=console).log.apply(t,arguments)},this.onComplete=e.onComplete||function(){},this.format=e.format||function(t){return""+o+JSON.stringify(t)}}return t.prototype.suiteStarted=function(t){t=i({},t,{id:o.call(this,t,"suiteStarted")}),this.print(this.format(t))},t.prototype.suiteDone=function(t){t=i({},t,{id:o.call(this,t,"suiteDone"),specs:this.specResults}),this.print(this.format(t)),this.specResults=[]},t.prototype.specStarted=function(t){t=i({},t,{id:o.call(this,t,"specStarted")}),this.print(this.format(t))},t.prototype.specDone=function(t){t=i({},t,{id:o.call(this,t,"specDone")}),this.print(this.format(t)),this.specResults.push(t)},t.prototype.jasmineStarted=function(t){t=i({},t,{id:o.call(this,t,"jasmineStarted")}),this.print(this.format(t))},t.prototype.jasmineDone=function(t){this.onComplete(t)},t}();a.defaultHeader="",t.exports=a},function(t,e,r){function n(t,e,r){var n=e&&r||0,o=0;for(e=e||[],t.toLowerCase().replace(/[0-9a-f]{2}/g,function(t){o<16&&(e[n+o++]=u[t])});o<16;)e[n+o++]=0;return e}function o(t,e){var r=e||0,n=c;return n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]}function i(t,e,r){var n=e&&r||0,i=e||[];t=t||{};var s=void 0!==t.clockseq?t.clockseq:d,a=void 0!==t.msecs?t.msecs:(new Date).getTime(),c=void 0!==t.nsecs?t.nsecs:v+1,u=a-h+(c-v)/1e4;if(u<0&&void 0===t.clockseq&&(s=s+1&16383),(u<0||a>h)&&void 0===t.nsecs&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");h=a,v=c,d=s,a+=122192928e5;var f=(1e4*(268435455&a)+c)%4294967296;i[n++]=f>>>24&255,i[n++]=f>>>16&255,i[n++]=f>>>8&255,i[n++]=255&f;var p=a/4294967296*1e4&268435455;i[n++]=p>>>8&255,i[n++]=255&p,i[n++]=p>>>24&15|16,i[n++]=p>>>16&255,i[n++]=s>>>8|128,i[n++]=255&s;for(var m=t.node||l,y=0;y<6;y++)i[n+y]=m[y];return e?e:o(i)}function s(t,e,r){var n=e&&r||0;"string"==typeof t&&(e="binary"==t?new Array(16):null,t=null),t=t||{};var i=t.random||(t.rng||a)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e)for(var s=0;s<16;s++)e[n+s]=i[s];return e||o(i)}for(var a=r(2),c=[],u={},f=0;f<256;f++)c[f]=(f+256).toString(16).substr(1),u[c[f]]=f;var p=a(),l=[1|p[0],p[1],p[2],p[3],p[4],p[5]],d=16383&(p[6]<<8|p[7]),h=0,v=0,m=s;m.v1=i,m.v4=s,m.parse=n,m.unparse=o,t.exports=m},function(t,e){(function(e){var r;if(e.crypto&&crypto.getRandomValues){var n=new Uint8Array(16);r=function(){return crypto.getRandomValues(n),n}}if(!r){var o=new Array(16);r=function(){for(var t,e=0;e<16;e++)0===(3&e)&&(t=4294967296*Math.random()),o[e]=t>>>((3&e)<<3)&255;return o}}t.exports=r}).call(e,function(){return this}())}])});

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

function generateId(_ref, name) {
var id = _ref.id;
return [this.uuid, id, name].filter(Boolean).join(':');
}
var JsonStreamReporter = function () {

@@ -16,5 +22,9 @@ function JsonStreamReporter() {

this._specResults = [];
this._uuid = uuid.v4();
var _options$header = options.header;
var header = _options$header === undefined ? JsonStreamReporter.defaultHeader : _options$header;
this.specResults = [];
this.uuid = uuid.v4();
/* eslint-disable no-console */

@@ -28,23 +38,44 @@ this.print = options.print || function () {

/* eslint-enable no-console */
this.format = options.format || function (obj) {
return '' + header + JSON.stringify(obj);
};
}
JsonStreamReporter.prototype.suiteStarted = function suiteStarted(suite) {
suite = _extends({}, suite, { id: generateId.call(this, suite, 'suiteStarted') });
this.print(this.format(suite));
};
JsonStreamReporter.prototype.suiteDone = function suiteDone(suite) {
suite = _extends({}, suite, { id: [this._uuid, suite.id, 'suite'].join(':'), specs: this._specResults });
this.print(JSON.stringify(suite));
this._specResults = [];
suite = _extends({}, suite, { id: generateId.call(this, suite, 'suiteDone'), specs: this.specResults });
this.print(this.format(suite));
this.specResults = [];
};
JsonStreamReporter.prototype.specStarted = function specStarted(spec) {
spec = _extends({}, spec, { id: generateId.call(this, spec, 'specStarted') });
this.print(this.format(spec));
};
JsonStreamReporter.prototype.specDone = function specDone(spec) {
spec = _extends({}, spec, { id: [this._uuid, spec.id, 'spec'].join(':') });
this.print(JSON.stringify(spec));
this._specResults.push(spec);
spec = _extends({}, spec, { id: generateId.call(this, spec, 'specDone') });
this.print(this.format(spec));
this.specResults.push(spec);
};
JsonStreamReporter.prototype.jasmineDone = function jasmineDone() {
this.onComplete.apply(this, arguments);
JsonStreamReporter.prototype.jasmineStarted = function jasmineStarted(specInfo) {
specInfo = _extends({}, specInfo, { id: generateId.call(this, specInfo, 'jasmineStarted') });
this.print(this.format(specInfo));
};
JsonStreamReporter.prototype.jasmineDone = function jasmineDone(options) {
this.onComplete(options);
};
return JsonStreamReporter;
}();
JsonStreamReporter.defaultHeader = '';
module.exports = JsonStreamReporter;
{
"name": "jasmine-json-stream-reporter",
"version": "0.0.5",
"version": "0.0.6",
"description": "jasmine json stream reporter",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -20,14 +20,26 @@ 'use strict';

var failures = 0;
var result = {};
reporter.jasmineStarted(result);
var specInfo = void 0;
function specDone(chunk) {
if (chunk.status === 'failed') failures++;
}
function jasmineStarted(s) {
specInfo = s;
}
var events = { specStarted: true, specDone: specDone, suiteStarted: true, suiteDone: true, jasmineStarted: jasmineStarted, jasmineDone: true };
return through(function (chunk, enc, next) {
if (chunk.id.endsWith(':spec')) {
if (chunk.status === 'failed') failures++;
reporter.specDone(chunk);
} else if (chunk.id.endsWith(':suite')) {
reporter.suiteDone(chunk);
for (var key in events) {
if (events.hasOwnProperty(key)) {
var value = events[key];
if (!chunk.id.endsWith(':' + key)) continue;
if (typeof value === 'function') value(chunk);
if (key in reporter) reporter[key](chunk);
break;
}
}
next(null, chunk);
}, function (flush) {
reporter.jasmineDone(result);
reporter.jasmineDone();
if (failures) handleFailures.call(this, failures, onError);

@@ -34,0 +46,0 @@ flush();

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