requires-regex
Advanced tools
Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "requires-regex", | ||
"description": "Regular expressions for node.js require statements.", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"homepage": "https://github.com/jonschlinkert/requires-regex", | ||
@@ -6,0 +6,0 @@ "author": { |
15
test.js
@@ -18,11 +18,14 @@ /*! | ||
it('should match require statements without a var', function () { | ||
console.log(re().exec('var isDir = require(\'is-directory\');')); | ||
it('should return the full statement, variable name, and module path', function () { | ||
var m = re().exec('var isDir = require(\'is-directory\');'); | ||
m[0].should.equal('var isDir = require(\'is-directory\')'); | ||
m[1].should.equal('var isDir = '); | ||
m[2].should.equal('isDir'); | ||
m[3].should.equal('is-directory'); | ||
}); | ||
it('should match require statements without a var', function () { | ||
console.log('var path = require(\'path\');\n\nvar list = require(\'dirs\');'.match(re())); | ||
it('should return an array of matches', function () { | ||
var m = 'var path = require(\'path\');\n\nvar list = require(\'dirs\');'.match(re()); | ||
m.should.eql([ 'var path = require(\'path\')', 'var list = require(\'dirs\')' ]); | ||
}); | ||
}); |
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
6501
32