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

'Use strict' @top and updated the file with const/let [issue-702] #726

Merged
merged 2 commits into from Feb 5, 2019
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+9 −8
Diff settings

Always

Just for now

@@ -1,6 +1,7 @@
var Filer = require('../../src');
var util = require('../lib/test-utils');
var expect = require('chai').expect;
'use strict';
const Filer = require('../../src');
const util = require('../lib/test-utils');
const expect = require('chai').expect;

describe('Filer', function() {
it('is defined', function() {
@@ -45,21 +46,21 @@ describe('Filer', function() {
});

it('must honor the \'FORMAT\' flag', function(done) {
var name = 'local-test';
let name = 'local-test';

This comment has been minimized.

Copy link
@pbrahmbhatt3

pbrahmbhatt3 Jan 31, 2019

Contributor

Hi @SahibArora

Suggested change
let name = 'local-test';
const name = 'local-test';

I think you can update the name variable to be a const as it is not getting reassigned in the code.

This comment has been minimized.

Copy link
@SahibArora

SahibArora Feb 1, 2019

Author Contributor

Hi @pbrahmbhatt3,
Thanks for coming and looking over.
I will do the necessary changes.

// Because we need to use a bunch of Filer filesystems
// in this test, we can't use the usual test infrastructure
// to create/manage the fs instance. Pick the best one
// based on the testing environment (browser vs. node)
var providers = Filer.FileSystem.providers;
var Provider;
const providers = Filer.FileSystem.providers;
let Provider;
if(providers.IndexedDB.isSupported()) {
Provider = providers.IndexedDB;
} else {
Provider = providers.Memory;
}

var fs = new Filer.FileSystem({name, provider: new Provider(name)});
var fs2 = new Filer.FileSystem({name, provider: new Provider(name)});
let fs = new Filer.FileSystem({name, provider: new Provider(name)});
let fs2 = new Filer.FileSystem({name, provider: new Provider(name)});

fs.mkdir('/test', function(err){
if(err) throw err;
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.