is-absolute
Advanced tools
Comparing version 0.1.4 to 0.1.5
{ | ||
"name": "is-absolute", | ||
"description": "Return true if a file path is absolute.", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"homepage": "https://github.com/jonschlinkert/is-absolute", | ||
@@ -50,3 +50,3 @@ "author": { | ||
"verb": ">= 0.2.6", | ||
"verb-tag-jscomments": ">= 0.1.4" | ||
"verb-tag-jscomments": ">= 0.2.0" | ||
}, | ||
@@ -53,0 +53,0 @@ "dependencies": { |
24
test.js
@@ -10,7 +10,21 @@ /*! | ||
var path = require('path'); | ||
var assert = require('assert'); | ||
var isAbsolute = require('../'); | ||
var isAbsolute = require('./'); | ||
describe('isAbsolute()', function(){ | ||
it('should support windows', function(){ | ||
describe('isAbsolute()', function () { | ||
it('should support node.js', function () { | ||
assert(isAbsolute(__dirname)); | ||
assert(isAbsolute(__filename)); | ||
assert(isAbsolute(path.join(process.cwd()))); | ||
assert(isAbsolute(path.resolve(process.cwd(), 'README.md'))); | ||
assert(!isAbsolute(path.relative(process.cwd(), 'README.md'))); | ||
}); | ||
it('should work with glob patterns', function () { | ||
assert(isAbsolute(path.join(process.cwd(), 'pages/*.txt'))); | ||
assert(!isAbsolute('pages/*.txt')); | ||
}); | ||
it('should support windows', function () { | ||
assert(isAbsolute('c:\\')); | ||
@@ -23,3 +37,3 @@ assert(isAbsolute('//C://user\\docs\\Letter.txt')); | ||
it('should support windows unc', function(){ | ||
it('should support windows unc', function () { | ||
assert(isAbsolute('\\\\foo\\bar')) | ||
@@ -29,3 +43,3 @@ assert(isAbsolute('//UNC//Server01//user//docs//Letter.txt')); | ||
it('should support unices', function(){ | ||
it('should support unices', function () { | ||
assert(isAbsolute('/foo/bar')); | ||
@@ -32,0 +46,0 @@ assert(!isAbsolute('foo/bar')); |
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
8135
121