literate-jasmine
Advanced tools
Comparing version 0.0.18 to 0.0.19
{ | ||
"name": "literate-jasmine", | ||
"description": "write tests in markdown that are parsed and then run using jasmine", | ||
"version": "0.0.18", | ||
"description": "write jasmine tests in markdown", | ||
"version": "0.0.19", | ||
"bin": { | ||
@@ -6,0 +6,0 @@ "literate-jasmine": "./bin/literate-jasmine" |
@@ -9,2 +9,18 @@ require('jasmine-node'); | ||
var isHeader = function(node) { | ||
return node[0] === 'header'; | ||
}; | ||
var isCodeBlock = function(node) { | ||
return node[0] === 'code_block'; | ||
}; | ||
var getName = function(node) { | ||
return node[2]; | ||
}; | ||
var getLevel = function(node) { | ||
return node[1].level; | ||
}; | ||
parser = { | ||
@@ -15,3 +31,3 @@ parse: function(text) { | ||
complete = { | ||
name: root[2], | ||
name: getName(root), | ||
describes: [] | ||
@@ -50,3 +66,3 @@ }; | ||
parsedDescribe = { | ||
name: node[2], | ||
name: getName(node), | ||
it: [] | ||
@@ -62,3 +78,3 @@ }; | ||
if (!child || child[0] === 'header' && child[1].level < IT_LEVEL) { | ||
if (!child || isHeader(child) && getLevel(child) < IT_LEVEL) { | ||
break; | ||
@@ -86,3 +102,3 @@ } | ||
it = { | ||
name: node[2] | ||
name: getName(node) | ||
}; | ||
@@ -104,7 +120,7 @@ | ||
if (!child || child[0] === 'header') { | ||
if (!child || isHeader(child)) { | ||
break; | ||
} | ||
if (child[0] === 'code_block') { | ||
if (isCodeBlock(child)) { | ||
code_blocks.push(child[1]); | ||
@@ -111,0 +127,0 @@ } |
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
91200
285