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

Fix issue #681: Updated filer/tests/spec/filer.filesystem.spec.js #695

Merged
merged 3 commits into from
Feb 1, 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
15 changes: 8 additions & 7 deletions tests/spec/filer.filesystem.spec.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
var Filer = require('../../src');
var util = require('../lib/test-utils.js');
var expect = require('chai').expect;
'use strict';
const Filer = require('../../src');
const util = require('../lib/test-utils.js');
const expect = require('chai').expect;

describe('Filer.FileSystem', function() {
beforeEach(util.setup);
afterEach(util.cleanup);

it('should properly mount new or existing filesystem', function(done) {
var provider = util.provider().provider;
const provider = util.provider().provider;

// 1) Should be able to open a new filesystem, and get empty root
var fs1 = new Filer.FileSystem({provider: provider}, function() {
const fs1 = new Filer.FileSystem({provider: provider}, function() {
fs1.readdir('/', function(err, entries) {
expect(err).not.to.exist;
expect(entries).to.be.an('array');
Expand All @@ -20,7 +21,7 @@ describe('Filer.FileSystem', function() {
if(err) throw err;

// 2) Should be able to open an existing filesystem
var fs2 = new Filer.FileSystem({provider: provider}, function() {
const fs2 = new Filer.FileSystem({provider: provider}, function() {
fs2.readdir('/', function(err, entries) {
expect(err).not.to.exist;
expect(entries).to.be.an('array');
Expand All @@ -29,7 +30,7 @@ describe('Filer.FileSystem', function() {


// 3) FORMAT flag should wipe an existing filesystem
var fs3 = new Filer.FileSystem({provider: provider, flags: ['FORMAT']}, function() {
const fs3 = new Filer.FileSystem({provider: provider, flags: ['FORMAT']}, function() {
fs3.readdir('/', function(err, entries) {
expect(err).not.to.exist;
expect(entries).to.be.an('array');
Expand Down