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

@jymfony/exceptions

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jymfony/exceptions - npm Package Compare versions

Comparing version 0.1.0-alpha.14 to 0.1.0-alpha.15

2

lib/Exception.js

@@ -101,3 +101,3 @@ const UNKNOWN_FUNCTION = '?';

static parseStackTrace(error) {
const regex = /^\s*at (?:((?:\[object object])?\S+(?: \[as \S+])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i,
const regex = /^\s*at (?:async )?(?:((?:\[object object])?\S+(?: \[as \S+])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i,
lines = error.stack.split('\n'),

@@ -104,0 +104,0 @@ stack = [];

{
"name": "@jymfony/exceptions",
"version": "0.1.0-alpha.14",
"version": "0.1.0-alpha.15",
"description": "Jymfony exception (core package)",

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

@@ -6,18 +6,40 @@ const expect = require('chai').expect;

describe('[Exceptions] Exception', function () {
it('registered in global namespace', function () {
it('registered in global namespace', () => {
return expect(Exception).to.be.not.undefined;
});
it('Is instance of Error', function () {
it('Is instance of Error', () => {
return expect(new Exception()).to.be.an.instanceof(Error);
});
it('Inherits name', function () {
it('Inherits name', () => {
return expect((new TestException()).name).to.be.equal('TestException');
});
it('Captures stack', function () {
it('Captures stack', () => {
const ex = new Exception();
return expect(ex.stack).to.be.not.empty;
});
const [ major, minor ] = process.versions.v8.split('.', 3);
it('should parse async stack traces', 7 < ~~major || (7 === ~~major && 3 <= ~~minor) ? () => {
async function functionOne() {
await new Promise((resolve) => {
setTimeout(() => resolve(), 1);
});
throw new Error('Something Bad');
}
async function functionTwo() {
await functionOne();
}
functionTwo().catch((error) => {
const stack = Exception.parseStackTrace(error);
expect(stack).to.have.length(2);
expect(stack[0].function).to.be.equal('functionOne');
expect(stack[1].function).to.be.equal('functionTwo');
});
} : undefined);
});

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