fix tests to not delete folder while running

This commit is contained in:
Mark Nadal 2019-04-25 20:10:04 -07:00
parent ecffdce786
commit da431c06bc
2 changed files with 9 additions and 12 deletions

View File

@ -7,13 +7,12 @@ var Gun;
root = env.window? env.window : global;
try{ env.window && root.localStorage && root.localStorage.clear() }catch(e){}
try{ indexedDB.deleteDatabase('radatatest') }catch(e){}
try{ require('fs').unlinkSync('data.json') }catch(e){}
try{ require('../../lib/fsrm')('radatatest') }catch(e){}
//root.Gun = root.Gun || require('../gun');
if(root.Gun){
root.Gun = root.Gun;
root.Gun.TESTING = true;
} else {
try{ require('fs').unlinkSync('data.json') }catch(e){}
try{ require('../../lib/fsrm')('radatatest') }catch(e){}
root.Gun = require('../../gun');
root.Gun.TESTING = true;
//require('../lib/file');

View File

@ -7,24 +7,22 @@ var Gun;
root = env.window? env.window : global;
try{ env.window && root.localStorage && root.localStorage.clear() }catch(e){}
try{ indexedDB.deleteDatabase('radatatest') }catch(e){}
try{ require('fs').unlinkSync('data.json') }catch(e){}
try{ require('../../lib/fsrm')('radatatest') }catch(e){}
//root.Gun = root.Gun || require('../gun');
if(root.Gun){
root.Gun = root.Gun;
root.Gun.TESTING = true;
} else {
try{ require('fs').unlinkSync('data.json') }catch(e){}
try{ require('../../lib/fsrm')('radatatest') }catch(e){}
root.Gun = require('../../gun');
root.Gun.TESTING = true;
//require('../lib/file');
require('../lib/store');
require('../lib/rfs');
require('../../lib/store');
require('../../lib/rfs');
}
if(root.Gun.SEA){
//Gun = root.Gun = root.Gun;
} else {
var expect = global.expect = require("../expect");
try{ var expect = global.expect = require("../expect") }catch(e){}
if(!root.Gun.SEA){
require('../../sea.js');
}
}(this));