jasmine-extract
v0.0.1
Published
extract info about jasmine specs
Downloads
1
Maintainers
Readme
jasmine-extract
extract jasmine specs so you can add them to your docs
Install
npm install jasmine-extract
Usage
Requires esprima.
Takes an AST, returns an object corresponding to the test structure:
var esprima = require('esprima');
var fs = require('fs');
var extract = require('../extract');
var contents = fs.readFileSync(__dirname + '/input.spec.js', 'utf8');
var ast = esprima.parse(contents, {range: false});
console.log(extract(ast));
// logs this:
//
// { before: [],
// beforeEach: [],
// its: {},
// describes:
// { foo:
// { before: [Object],
// beforeEach: [Object],
// its: [Object],
// describes: {} } } }
License
MIT