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

* filer.spec.js var changed to const/let

* let changed to const for a local variable, which is constant through out
This commit is contained in:
Sahib Arora 2019-02-05 13:46:58 -05:00 committed by David Humphrey
parent da1aad5667
commit b5e1d9a82b
1 changed files with 9 additions and 8 deletions

View File

@ -1,6 +1,7 @@
var Filer = require('../../src'); 'use strict';
var util = require('../lib/test-utils'); const Filer = require('../../src');
var expect = require('chai').expect; const util = require('../lib/test-utils');
const expect = require('chai').expect;
describe('Filer', function() { describe('Filer', function() {
it('is defined', function() { it('is defined', function() {
@ -45,21 +46,21 @@ describe('Filer', function() {
}); });
it('must honor the \'FORMAT\' flag', function(done) { it('must honor the \'FORMAT\' flag', function(done) {
var name = 'local-test'; const name = 'local-test';
// Because we need to use a bunch of Filer filesystems // Because we need to use a bunch of Filer filesystems
// in this test, we can't use the usual test infrastructure // in this test, we can't use the usual test infrastructure
// to create/manage the fs instance. Pick the best one // to create/manage the fs instance. Pick the best one
// based on the testing environment (browser vs. node) // based on the testing environment (browser vs. node)
var providers = Filer.FileSystem.providers; const providers = Filer.FileSystem.providers;
var Provider; let Provider;
if(providers.IndexedDB.isSupported()) { if(providers.IndexedDB.isSupported()) {
Provider = providers.IndexedDB; Provider = providers.IndexedDB;
} else { } else {
Provider = providers.Memory; Provider = providers.Memory;
} }
var fs = new Filer.FileSystem({name, provider: new Provider(name)}); let fs = new Filer.FileSystem({name, provider: new Provider(name)});
var fs2 = new Filer.FileSystem({name, provider: new Provider(name)}); let fs2 = new Filer.FileSystem({name, provider: new Provider(name)});
fs.mkdir('/test', function(err){ fs.mkdir('/test', function(err){
if(err) throw err; if(err) throw err;