mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2026-04-20 00:17:04 +00:00
refactored out loadFile()
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
"use strict";
|
||||
|
||||
var vm = require('vm');
|
||||
var fs = require('fs');
|
||||
var assert = require('assert');
|
||||
var includeInThisContext = function(path) {
|
||||
var code = fs.readFileSync(path);
|
||||
vm.runInThisContext(code, path);
|
||||
};
|
||||
|
||||
includeInThisContext("localForage/dist/localforage.nopromises.js");
|
||||
includeInThisContext("src/store.js");
|
||||
|
||||
var testplatform = "__TEST__";
|
||||
|
||||
var localItems = {};
|
||||
|
||||
global.localStorage = {
|
||||
getItem: function(k) {
|
||||
return localItems[k];
|
||||
},
|
||||
setItem: function(k,v) {
|
||||
localItems[k] = v;
|
||||
}
|
||||
};
|
||||
|
||||
describe('Store', function() {
|
||||
it('Should create persistent store', function() {
|
||||
var store = createNewPersistentStore(testplatform);
|
||||
// TODO
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user