@jymfony/exceptions
Advanced tools
Comparing version 0.1.0-alpha.17 to 0.1.0-alpha.18
@@ -101,3 +101,3 @@ const UNKNOWN_FUNCTION = '?'; | ||
static parseStackTrace(error) { | ||
const regex = /^\s*at (?:async )?(?:((?:\[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'), | ||
@@ -134,2 +134,3 @@ stack = []; | ||
Error.prepareStackTrace = Exception.prepareStackTrace; | ||
global.Exception = Exception; |
{ | ||
"name": "@jymfony/exceptions", | ||
"version": "0.1.0-alpha.17", | ||
"version": "0.1.0-alpha.18", | ||
"description": "Jymfony exception (core package)", | ||
@@ -21,4 +21,4 @@ "main": "index.js", | ||
"devDependencies": { | ||
"chai": "^3.5.0", | ||
"mocha": "^5.0" | ||
"chai": "^4.2", | ||
"mocha": "^6.0" | ||
}, | ||
@@ -25,0 +25,0 @@ "config": { |
@@ -1,2 +0,2 @@ | ||
const expect = require('chai').expect; | ||
const { expect } = require('chai'); | ||
@@ -3,0 +3,0 @@ describe('[Exceptions] BadMethodCallException', function () { |
@@ -1,2 +0,2 @@ | ||
const expect = require('chai').expect; | ||
const { expect } = require('chai'); | ||
@@ -3,0 +3,0 @@ describe('[Exceptions] DomainException', function () { |
@@ -1,2 +0,2 @@ | ||
const expect = require('chai').expect; | ||
const { expect } = require('chai'); | ||
@@ -23,2 +23,15 @@ class TestException extends Exception {} | ||
it('should parse stack traces without line', () => { | ||
const stack = ` | ||
at CallCenter.makeCall (/var/jymfony/src/Component/Testing/src/Call/CallCenter.js) | ||
at ObjectProphecy.makeProphecyMethodCall (/var/jymfony/src/Component/Testing/src/Prophecy/ObjectProphecy.js) | ||
at /var/jymfony/src/Component/EventDispatcher/src/Debug/TraceableEventDispatcher.js`; | ||
expect(Exception.parseStackTrace({ stack })).to.be.deep.equal([ | ||
{ file: '/var/jymfony/src/Component/Testing/src/Call/CallCenter.js', function: 'CallCenter.makeCall', line: 0 }, | ||
{ file: '/var/jymfony/src/Component/Testing/src/Prophecy/ObjectProphecy.js', function: 'ObjectProphecy.makeProphecyMethodCall', line: 0 }, | ||
{ file: '/var/jymfony/src/Component/EventDispatcher/src/Debug/TraceableEventDispatcher.js', function: '?', line: 0 }, | ||
]); | ||
}); | ||
const [ major, minor ] = process.versions.v8.split('.', 3); | ||
@@ -25,0 +38,0 @@ it('should parse async stack traces', 7 < ~~major || (7 === ~~major && 3 <= ~~minor) ? () => { |
@@ -1,2 +0,2 @@ | ||
const expect = require('chai').expect; | ||
const { expect } = require('chai'); | ||
@@ -3,0 +3,0 @@ describe('[Exceptions] InvalidArgumentException', function () { |
@@ -1,2 +0,2 @@ | ||
const expect = require('chai').expect; | ||
const { expect } = require('chai'); | ||
@@ -3,0 +3,0 @@ describe('[Exceptions] LogicException', function () { |
@@ -1,2 +0,2 @@ | ||
const expect = require('chai').expect; | ||
const { expect } = require('chai'); | ||
@@ -3,0 +3,0 @@ describe('[Exceptions] OutOfBoundsException', function () { |
@@ -1,2 +0,2 @@ | ||
const expect = require('chai').expect; | ||
const { expect } = require('chai'); | ||
@@ -3,0 +3,0 @@ describe('[Exceptions] RuntimeException', function () { |
@@ -1,2 +0,2 @@ | ||
const expect = require('chai').expect; | ||
const { expect } = require('chai'); | ||
@@ -3,0 +3,0 @@ describe('[Exceptions] UnderflowException', function () { |
@@ -1,2 +0,2 @@ | ||
const expect = require('chai').expect; | ||
const { expect } = require('chai'); | ||
@@ -3,0 +3,0 @@ describe('[Exceptions] UnexpectedValueException', function () { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13408
332