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

500-pagelet

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

500-pagelet - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

.travis.yml

11

index.js

@@ -23,8 +23,10 @@ 'use strict';

* @param {Error} error Error data and stack.
* @param {String} name Pagelet name that the Error pagelet replaces.
* @api public
*/
constructor: function constructor(options, error) {
constructor: function constructor(options, error, name) {
Pagelet.prototype.constructor.call(this, options);
this.error = error instanceof Error ? error : {};
if (name) this.name = name;
this.data = error instanceof Error ? error : {};
},

@@ -40,6 +42,7 @@

render(null, {
message: this.error.message,
stack: this.env !== 'production' ? this.error.stack : ''
env: this.env,
message: this.data.message,
stack: this.env !== 'production' ? this.data.stack : ''
});
}
}).on(module);
{
"name": "500-pagelet",
"version": "1.0.1",
"version": "1.0.2",
"description": "Default 500 Pagelet used if anything fails in BigPipe",

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

"dependencies": {
"pagelet": "1.0.x",
"pagelet": "1.0.0-alpha",
"diagnostics-pagelet": "1.0.x"

@@ -20,0 +20,0 @@ },

@@ -62,3 +62,3 @@ describe('500 Pagelet', function () {

assume(Fivehundred).is.a('function');
assume(Fivehundred.length).to.equal(2);
assume(Fivehundred.length).to.equal(3);
});

@@ -69,7 +69,13 @@

assume(pagelet.error).to.be.instanceof(Error);
assume(pagelet.error).to.have.property('message', 'failed test');
assume(pagelet.error).to.have.property('stack');
assume(pagelet.error.stack).to.be.an('string');
assume(pagelet.data).to.be.instanceof(Error);
assume(pagelet.data).to.have.property('message', 'failed test');
assume(pagelet.data).to.have.property('stack');
assume(pagelet.data.stack).to.be.an('string');
});
it('can be provided with the name of the Pagelet it replaces', function () {
pagelet = new Fivehundred({ temper: new Temper }, new Error('failed test'), 'search');
assume(pagelet.name).to.equal('search');
});
});

@@ -86,3 +92,3 @@

pagelet.error = err;
pagelet.data = err;
pagelet.get(function (error, data) {

@@ -99,6 +105,7 @@ assume(error).to.equal(null);

pagelet.error = err;
pagelet.data = err;
pagelet.env = 'production';
pagelet.get(function (error, data) {
assume(error).to.equal(null);
assume(data.env).to.equal(pagelet.env);
assume(data.message).to.equal(err.message);

@@ -105,0 +112,0 @@ assume(data.stack).to.not.equal(err.stack);

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