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

literate-jasmine

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

literate-jasmine - npm Package Compare versions

Comparing version 0.0.19 to 0.0.20

spec/integration.js

13

package.json
{
"name": "literate-jasmine",
"description": "write jasmine tests in markdown",
"version": "0.0.19",
"version": "0.0.20",
"bin": {

@@ -9,4 +9,7 @@ "literate-jasmine": "./bin/literate-jasmine"

"dependencies": {
"colors": "0.6.2",
"jasmine-node": "1.13.1",
"markdown": "0.5.0"
"lodash": "2.4.1",
"markdown": "0.5.0",
"stack-trace-parser": "0.0.6"
},

@@ -17,3 +20,4 @@ "engines": {

"devDependencies": {
"jasmine-node": "1.13.1"
"jasmine-node": "1.13.1",
"sinon": "1.8.2"
},

@@ -29,4 +33,5 @@ "licenses": [{

"scripts": {
"test": "jasmine-node --forceexit spec && ./bin/literate-jasmine README.md"
"test": "jasmine-node --forceexit spec && ./bin/literate-jasmine README.md",
"integration": "node spec/integration.js"
}
}
var parser = require('../src/parser'),
fs = require('fs'),
markdown = require('markdown').markdown;

@@ -3,0 +4,0 @@

require('jasmine-node');
var markdown = require('markdown').markdown,
var colors = require('colors'),
markdown = require('markdown').markdown,
stackTraceParser = require('stack-trace-parser'),
ROOT_LEVEL = 1,

@@ -26,2 +28,19 @@ DESCRIBE_LEVEL = 2,

parser = {
displayEvalException: function(exception, name, code) {
var parsedStackTrace = stackTraceParser.parse(exception);
if (parsedStackTrace[0].isEval) {
console.log('\n');
console.log(exception.toString().red, 'thrown from', name.red + ':');
console.log('. . . . .');
var errorOnLineNumber = parsedStackTrace[0].evalLineNumber - 2;
code.split('\n').forEach(function(line, index) {
if (index == errorOnLineNumber) {
line = line.red;
}
console.log(line);
});
console.log('. . . . .\n');
}
},
parse: function(text) {

@@ -104,3 +123,11 @@ var tree = markdown.parse(text),

it.fn = new Function(it.code);
it.fn = function() {
try {
return new Function(it.code)();
}
catch (exception) {
parser.displayEvalException(exception, it.name, it.code);
throw exception;
}
}

@@ -107,0 +134,0 @@ return it;

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