stack-trace-parser
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -10,7 +10,7 @@ var stackTraceParser = require('./src/parser') | ||
assert(stackTrace.type === 'ReferenceError', "Expected stack trace type to be ReferenceError but instead it is " + stackTrace.type); | ||
assert.strictEqual(stackTrace.message, 'd is not defined', "Expected stack trace message to be 'd is not defined' but instead it is: " + stackTrace.message); | ||
assert(stackTrace[0].fileName.indexOf('example-undefined.js') !== -1, "Expected file name to contain 'example-undefined.js'!"); | ||
assert.strictEqual(stackTrace[0].lineNumber, 5, "Expected line number to match line 5 of this file not " + stackTrace[0].lineNumber); | ||
assert.strictEqual(stackTrace[0].columnNumber, 7, "Expected column number to match column 7 of this file not " + stackTrace[0].columnNumber); | ||
throw exception; | ||
} |
@@ -10,2 +10,4 @@ var stackTraceParser = require('./src/parser') | ||
assert(stackTrace.type === 'Error', "Expected stack trace type to be Error but instead it is " + stackTrace.type); | ||
assert.strictEqual(stackTrace.message, 'just got real', "Expected stack trace message to be 'just got real' but instead it is: " + stackTrace.message); | ||
assert(stackTrace[0].fileName.indexOf('example.js') !== -1, "Expected file name to contain 'example.js'!"); | ||
@@ -12,0 +14,0 @@ assert.strictEqual(stackTrace[0].lineNumber, 5, "Expected line number to match line 5 of this file!"); |
{ | ||
"name": "stack-trace-parser", | ||
"description": "parse stack trace", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"main": "src/parser.js", | ||
@@ -6,0 +6,0 @@ "dependencies": {}, |
@@ -9,3 +9,3 @@ # stack-trace-parser [![Build Status](https://travis-ci.org/cymen/node-stack-trace-parser.png?branch=master)](https://travis-ci.org/cymen/node-stack-trace-parser) | ||
### example (from `example.js`) | ||
### example of Error exception (see `example.js`) | ||
@@ -21,2 +21,4 @@ var stackTraceParser = require('./src/parser') | ||
assert(stackTrace.type === 'Error', "Expected stack trace type to be Error but instead it is " + stackTrace.type); | ||
assert.strictEqual(stackTrace.message, 'just got real', "Expected stack trace message to be 'just got real' but instead it is: " + stackTrace.message); | ||
assert(stackTrace[0].fileName.indexOf('example.js') !== -1, "Expected file name to contain 'example.js'!"); | ||
@@ -26,1 +28,19 @@ assert.strictEqual(stackTrace[0].lineNumber, 5, "Expected line number to match line 5 of this file!"); | ||
} | ||
### example of ReferenceError exception (see `example-undefined.js`) | ||
var stackTraceParser = require('./src/parser') | ||
assert = require('assert'); | ||
try { | ||
d = d * 2; | ||
} | ||
catch (exception) { | ||
var stackTrace = stackTraceParser.parse(exception); | ||
assert(stackTrace.type === 'ReferenceError', "Expected stack trace type to be ReferenceError but instead it is " + stackTrace.type); | ||
assert.strictEqual(stackTrace.message, 'd is not defined', "Expected stack trace message to be 'd is not defined' but instead it is: " + stackTrace.message); | ||
assert(stackTrace[0].fileName.indexOf('example-undefined.js') !== -1, "Expected file name to contain 'example-undefined.js'!"); | ||
assert.strictEqual(stackTrace[0].lineNumber, 5, "Expected line number to match line 5 of this file not " + stackTrace[0].lineNumber); | ||
assert.strictEqual(stackTrace[0].columnNumber, 7, "Expected column number to match column 7 of this file not " + stackTrace[0].columnNumber); | ||
} |
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
10141
136
44