Merge pull request #733 from PriyankaCodes99/issue-685
issue-685 fix: replaced "var" with "let" in fs.unlink.spec.js
This commit is contained in:
commit
f4e0dce8d3
|
@ -1,18 +1,18 @@
|
||||||
var util = require('../lib/test-utils.js');
|
let util = require('../lib/test-utils.js');
|
||||||
var expect = require('chai').expect;
|
let expect = require('chai').expect;
|
||||||
|
|
||||||
describe('fs.unlink', function() {
|
describe('fs.unlink', function() {
|
||||||
beforeEach(util.setup);
|
beforeEach(util.setup);
|
||||||
afterEach(util.cleanup);
|
afterEach(util.cleanup);
|
||||||
|
|
||||||
it('should be a function', function() {
|
it('should be a function', function() {
|
||||||
var fs = util.fs();
|
const fs = util.fs();
|
||||||
expect(fs.unlink).to.be.a('function');
|
expect(fs.unlink).to.be.a('function');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should remove a link to an existing file', function(done) {
|
it('should remove a link to an existing file', function(done) {
|
||||||
var fs = util.fs();
|
let fs = util.fs();
|
||||||
var complete1, complete2;
|
let complete1, complete2;
|
||||||
|
|
||||||
function maybeDone() {
|
function maybeDone() {
|
||||||
if(complete1 && complete2) {
|
if(complete1 && complete2) {
|
||||||
|
@ -53,7 +53,7 @@ describe('fs.unlink', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not follow symbolic links', function(done) {
|
it('should not follow symbolic links', function(done) {
|
||||||
var fs = util.fs();
|
let fs = util.fs();
|
||||||
|
|
||||||
fs.symlink('/', '/myFileLink', function (error) {
|
fs.symlink('/', '/myFileLink', function (error) {
|
||||||
if (error) throw error;
|
if (error) throw error;
|
||||||
|
@ -85,7 +85,7 @@ describe('fs.unlink', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not unlink directories', function (done) {
|
it('should not unlink directories', function (done) {
|
||||||
var fs = util.fs();
|
let fs = util.fs();
|
||||||
|
|
||||||
fs.mkdir('/mydir', function (error) {
|
fs.mkdir('/mydir', function (error) {
|
||||||
if(error) throw error;
|
if(error) throw error;
|
||||||
|
@ -110,12 +110,12 @@ describe('fs.promises.unlink', function () {
|
||||||
afterEach(util.cleanup);
|
afterEach(util.cleanup);
|
||||||
|
|
||||||
it('should be a function', function () {
|
it('should be a function', function () {
|
||||||
var fs = util.fs();
|
let fs = util.fs();
|
||||||
expect(fs.promises.unlink).to.be.a('function');
|
expect(fs.promises.unlink).to.be.a('function');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return an error if trying to delete a file that does not exist', function() {
|
it('should return an error if trying to delete a file that does not exist', function() {
|
||||||
var fsPromises = util.fs().promises;
|
const fsPromises = util.fs().promises;
|
||||||
|
|
||||||
return fsPromises.unlink('/myFile')
|
return fsPromises.unlink('/myFile')
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
@ -125,7 +125,7 @@ describe('fs.promises.unlink', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not unlink directories', () => {
|
it('should not unlink directories', () => {
|
||||||
var fs = util.fs().promises;
|
let fs = util.fs().promises;
|
||||||
|
|
||||||
return fs.mkdir('/mydir')
|
return fs.mkdir('/mydir')
|
||||||
.then(() => fs.unlink('/mydir'))
|
.then(() => fs.unlink('/mydir'))
|
||||||
|
|
Loading…
Reference in New Issue