Comparing version 1.0.1 to 1.0.2
14
index.js
@@ -12,5 +12,3 @@ var acorn = require('acorn'); | ||
var ast; | ||
var parserOptions = { | ||
ecmaVersion: 6 | ||
}; | ||
var parserOptions = module.exports._getParserOptions(); | ||
@@ -27,1 +25,11 @@ // Returns an object if ok, if not, returns an empty array | ||
}; | ||
/** | ||
* Exposed for testing | ||
* @return {Object} | ||
*/ | ||
module.exports._getParserOptions = function() { | ||
return { | ||
ecmaVersion: 6 | ||
}; | ||
}; |
{ | ||
"name": "just-parse", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Enough configuration, just parse the goddamn file", | ||
@@ -28,4 +28,5 @@ "main": "index.js", | ||
"jscs": "~1.11.3", | ||
"mocha": "~2.1.0" | ||
"mocha": "~2.1.0", | ||
"sinon": "~1.15.4" | ||
} | ||
} |
@@ -5,2 +5,3 @@ var justParse = require('../'); | ||
var fs = require('fs'); | ||
var sinon = require('sinon'); | ||
@@ -25,2 +26,13 @@ describe('just-parse', function() { | ||
}); | ||
it('should parse scripts even with a source type of module', function() { | ||
var stub = sinon.stub(justParse, '_getParserOptions').returns({ | ||
ecmaVersion: 6, | ||
sourceType: 'module' | ||
}); | ||
var ast = justParse('#!/usr/bin/env node\nvar foo = 1;'); | ||
assert(ast instanceof Object); | ||
stub.restore(); | ||
}); | ||
}); |
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
4684
66
3