Commit 154f0305 authored by Tristan Cavelier's avatar Tristan Cavelier

replicatestorage tests added

parent 2c40da15
/*jslint indent: 2, maxlen: 80, nomen: true */
/*global define, jIO, jio_tests, test, ok, deepEqual, sinon, expect */
// define([module_name], [dependencies], module);
(function (dependencies, module) {
"use strict";
if (typeof define === 'function' && define.amd) {
return define(dependencies, module);
}
module(jIO, jio_tests);
}([
'jio',
'jio_tests',
'localstorage',
'replicatestorage'
], function (jIO, util) {
"use strict";
module("ReplicateStorage");
test("Substorage management", function () {
expect(1);
var clock = sinon.useFakeTimers(), jio = jIO.newJio({
"type": "replicate",
"storage_list": [{
"type": "dummy"
}, {
"type": "dummy",
"mode": "always fail",
}]
});
// post without id
jio.post({}, function (err, response) {
deepEqual(err || response, {
"id": "document id a",
"ok": true
}, "2 Storages DONE + FAIL = DONE");
});
clock.tick(10000);
util.closeAndcleanUpJio(jio);
});
}));
......@@ -21,6 +21,9 @@
<script src="../src/jio.storage/localstorage.js"></script>
<script src="./jio.storage/localstorage.tests.js"></script>
<script src="../src/jio.storage/replicatestorage.js"></script>
<script src="./jio.storage/replicatestorage.tests.js"></script>
<script src="../src/sha256.amd.js"></script>
<script src="../src/jio.storage/revisionstorage.js"></script>
<script src="./jio.storage/revisionstorage.tests.js"></script>
......
......@@ -16,6 +16,8 @@
"jio_tests": "jio/tests",
"localstorage": "../src/jio.storage/localstorage",
"localstorage_tests": "jio.storage/localstorage.tests",
"replicatestorage": "../src/jio.storage/replicatestorage",
"replicatestorage_tests": "jio.storage/replicatestorage.tests",
"revisionstorage": "../src/jio.storage/revisionstorage",
"revisionstorage_tests": "jio.storage/revisionstorage.tests",
"replicaterevisionstorage": "../src/jio.storage/replicaterevisionstorage",
......@@ -51,6 +53,7 @@
"complex_queries_tests",
"jio_tests",
"localstorage_tests",
"replicatestorage_tests",
"revisionstorage_tests",
"replicaterevisionstorage_tests",
"indexstorage_tests",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment