Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #661: replaced var with const #669

Merged
merged 2 commits into from
Jan 31, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions tests/spec/fs.symlink.spec.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
var util = require('../lib/test-utils.js');
var expect = require('chai').expect;
'use strict';

const util = require('../lib/test-utils.js');
const expect = require('chai').expect;

describe('fs.symlink', function () {
beforeEach(util.setup);
afterEach(util.cleanup);

it('should be a function', function () {
var fs = util.fs();
const fs = util.fs();
expect(fs.symlink).to.be.a('function');
});

it('should return an error if part of the parent destination path does not exist', function (done) {
var fs = util.fs();
const fs = util.fs();

fs.symlink('/', '/tmp/mydir', function (error) {
expect(error).to.exist;
Expand All @@ -21,7 +23,7 @@ describe('fs.symlink', function () {
});

it('should return an error if the destination path already exists', function (done) {
var fs = util.fs();
const fs = util.fs();

fs.symlink('/tmp', '/', function (error) {
expect(error).to.exist;
Expand All @@ -31,7 +33,7 @@ describe('fs.symlink', function () {
});

it('should create a symlink', function (done) {
var fs = util.fs();
const fs = util.fs();

fs.symlink('/', '/myfile', function (error) {
expect(error).not.to.exist;
Expand All @@ -47,7 +49,7 @@ describe('fs.symlink', function () {
/** Tests for fsPromises API */
describe('fsPromises.symlink', function () {
it('should return an error if destination path does not exist', function () {
var fsPromises = util.fs().promises;
const fsPromises = util.fs().promises;

return fsPromises.symlink('/', '/tmp/link')
.catch(error => {
Expand All @@ -57,7 +59,7 @@ describe('fs.symlink', function () {
});

it('should return an error if source path does not exist', function () {
var fsPromises = util.fs().promises;
const fsPromises = util.fs().promises;

return fsPromises.symlink('/tmp/myLink', '/myLink')
.catch(error => {
Expand All @@ -67,7 +69,7 @@ describe('fs.symlink', function () {
});

it('Promise should create a symlink of type DIRECTORY when directory provided', function () {
var fsPromises = util.fs().promises;
const fsPromises = util.fs().promises;

return fsPromises.symlink('/', '/myDirLink')
.then(() => fsPromises.stat('/myDirLink'))
Expand All @@ -78,7 +80,7 @@ describe('fs.symlink', function () {
});

it('Promise should create a symlink of type FILE when file provided', function () {
var fsPromises = util.fs().promises;
const fsPromises = util.fs().promises;

return fsPromises.writeFile('/myFile', 'data')
.then(() => fsPromises.symlink('/myFile', '/myFileLink'))
Expand All @@ -90,7 +92,7 @@ describe('fs.symlink', function () {
});

it('Promise should return an error if the destination path already exists', function () {
var fsPromises = util.fs().promises;
const fsPromises = util.fs().promises;

return fsPromises.symlink('/tmp', '/')
.catch(error => {
Expand All @@ -108,7 +110,7 @@ describe('fsPromises.symlink', function () {


it('should return an error if part of the parent destination path does not exist', () => {
var fsPromises = util.fs().promises;
const fsPromises = util.fs().promises;

return fsPromises.symlink('/', '/tmp/mydir')
.catch(error => {
Expand Down