fs-jetpack
Advanced tools
Comparing version 0.6.3 to 0.6.4
@@ -1,2 +0,2 @@ | ||
0.6.3 (2015-04-18) | ||
0.6.3 and 0.6.4 (2015-04-18) | ||
------------------- | ||
@@ -3,0 +3,0 @@ * Added support for symbolic links. |
@@ -20,5 +20,2 @@ "use strict"; | ||
fs.symlinkSync(symlinkValue, path); | ||
} else if (err.code === 'EPERM' && process.platform === 'win32') { | ||
err.message = 'Symbolic links are not supported on Windows platform'; | ||
throw err; | ||
} else { | ||
@@ -50,5 +47,2 @@ throw err; | ||
.then(deferred.resolve, deferred.reject); | ||
} else if (err.code === 'EPERM' && process.platform === 'win32') { | ||
err.message = 'Symbolic links are not supported on Windows platform'; | ||
deferred.reject(err); | ||
} else { | ||
@@ -55,0 +49,0 @@ deferred.reject(err); |
{ | ||
"name": "fs-jetpack", | ||
"description": "Better file system API", | ||
"version": "0.6.3", | ||
"version": "0.6.4", | ||
"author": "Jakub Szwacz <jakub@szwacz.com>", | ||
@@ -6,0 +6,0 @@ "dependencies": { |
@@ -13,117 +13,78 @@ "use strict"; | ||
describe('*nix specyfic |', function () { | ||
it("can create a symlink", function (done) { | ||
if (process.platform === 'win32') { | ||
return; | ||
} | ||
var preparations = function () { | ||
helper.clearWorkingDir(); | ||
}; | ||
it("can create a symlink", function (done) { | ||
var expectations = function () { | ||
expect(fse.lstatSync('symlink').isSymbolicLink()).toBe(true); | ||
expect(fse.readlinkSync('symlink')).toBe('some_path'); | ||
}; | ||
var preparations = function () { | ||
helper.clearWorkingDir(); | ||
}; | ||
// SYNC | ||
preparations(); | ||
jetpack.symlink('some_path', 'symlink'); | ||
expectations(); | ||
var expectations = function () { | ||
expect(fse.lstatSync('symlink').isSymbolicLink()).toBe(true); | ||
expect(fse.readlinkSync('symlink')).toBe('some/path'); | ||
}; | ||
// SYNC | ||
preparations(); | ||
jetpack.symlink('some/path', 'symlink'); | ||
// ASYNC | ||
preparations(); | ||
jetpack.symlinkAsync('some_path', 'symlink') | ||
.then(function () { | ||
expectations(); | ||
// ASYNC | ||
preparations(); | ||
jetpack.symlinkAsync('some/path', 'symlink') | ||
.then(function () { | ||
expectations(); | ||
done(); | ||
}); | ||
done(); | ||
}); | ||
}); | ||
it("can create nonexistent parent directories", function (done) { | ||
it("can create nonexistent parent directories", function (done) { | ||
var preparations = function () { | ||
helper.clearWorkingDir(); | ||
}; | ||
var preparations = function () { | ||
helper.clearWorkingDir(); | ||
}; | ||
var expectations = function () { | ||
expect(fse.lstatSync('a/b/symlink').isSymbolicLink()).toBe(true); | ||
}; | ||
var expectations = function () { | ||
expect(fse.lstatSync('a/b/symlink').isSymbolicLink()).toBe(true); | ||
}; | ||
// SYNC | ||
preparations(); | ||
jetpack.symlink('whatever', 'a/b/symlink'); | ||
expectations(); | ||
// SYNC | ||
preparations(); | ||
jetpack.symlink('whatever', 'a/b/symlink'); | ||
expectations(); | ||
// ASYNC | ||
preparations(); | ||
jetpack.symlinkAsync('whatever', 'a/b/symlink') | ||
.then(function () { | ||
expectations(); | ||
done(); | ||
}); | ||
}); | ||
it("respects internal CWD of jetpack instance", function (done) { | ||
var preparations = function () { | ||
helper.clearWorkingDir(); | ||
fse.mkdirsSync('a/b'); | ||
}; | ||
var expectations = function () { | ||
expect(fse.lstatSync('a/b/symlink').isSymbolicLink()).toBe(true); | ||
}; | ||
var jetContext = jetpack.cwd('a/b'); | ||
// SYNC | ||
preparations(); | ||
jetContext.symlink('whatever', 'symlink'); | ||
// ASYNC | ||
preparations(); | ||
jetpack.symlinkAsync('whatever', 'a/b/symlink') | ||
.then(function () { | ||
expectations(); | ||
// ASYNC | ||
preparations(); | ||
jetContext.symlinkAsync('whatever', 'symlink') | ||
.then(function () { | ||
expectations(); | ||
done(); | ||
}); | ||
done(); | ||
}); | ||
}); | ||
describe('windows specyfic |', function () { | ||
it("respects internal CWD of jetpack instance", function (done) { | ||
if (process.platform !== 'win32') { | ||
return; | ||
} | ||
var preparations = function () { | ||
helper.clearWorkingDir(); | ||
fse.mkdirsSync('a/b'); | ||
}; | ||
it("Throws nice error on Windows", function (done) { | ||
var expectations = function () { | ||
expect(fse.lstatSync('a/b/symlink').isSymbolicLink()).toBe(true); | ||
}; | ||
var expectations = function (err) { | ||
expect(err.code).toBe('EPERM'); | ||
expect(err.message).toBe('Symbolic links are not supported on Windows platform'); | ||
}; | ||
var jetContext = jetpack.cwd('a/b'); | ||
// SYNC | ||
try { | ||
jetpack.symlink('whatever', 'a/b/symlink'); | ||
throw "to make sure this code throws"; | ||
} catch (err) { | ||
expectations(err); | ||
} | ||
// SYNC | ||
preparations(); | ||
jetContext.symlink('whatever', 'symlink'); | ||
expectations(); | ||
// ASYNC | ||
jetpack.symlinkAsync('whatever', 'a/b/symlink') | ||
.catch(function (err) { | ||
expectations(err); | ||
done(); | ||
}); | ||
// ASYNC | ||
preparations(); | ||
jetContext.symlinkAsync('whatever', 'symlink') | ||
.then(function () { | ||
expectations(); | ||
done(); | ||
}); | ||
}); | ||
}); |
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
189492
4757