Commit 65e213a7 authored by Tristan Cavelier's avatar Tristan Cavelier

jslint s3 + multi split tests

parent fd52a421
...@@ -18,10 +18,6 @@ ...@@ -18,10 +18,6 @@
], function (jIO, util, RSVP) { ], function (jIO, util, RSVP) {
"use strict"; "use strict";
var tool = {
"readBlobAsBinaryString": jIO.util.readBlobAsBinaryString
};
function reverse(promise) { function reverse(promise) {
return new RSVP.Promise(function (resolve, reject, notify) { return new RSVP.Promise(function (resolve, reject, notify) {
promise.then(reject, resolve, notify); promise.then(reject, resolve, notify);
...@@ -30,46 +26,6 @@ ...@@ -30,46 +26,6 @@
}); });
} }
/**
* sequence(thens): Promise
*
* Executes a sequence of *then* callbacks. It acts like
* `smth().then(callback).then(callback)...`. The first callback is called
* with no parameter.
*
* Elements of `thens` array can be a function or an array contaning at most
* three *then* callbacks: *onFulfilled*, *onRejected*, *onNotified*.
*
* When `cancel()` is executed, each then promises are cancelled at the same
* time.
*
* @param {Array} thens An array of *then* callbacks
* @return {Promise} A new promise
*/
function sequence(thens) {
var promises = [];
return new RSVP.Promise(function (resolve, reject, notify) {
var i;
promises[0] = new RSVP.Promise(function (resolve) {
resolve();
});
for (i = 0; i < thens.length; i += 1) {
if (Array.isArray(thens[i])) {
promises[i + 1] = promises[i].
then(thens[i][0], thens[i][1], thens[i][2]);
} else {
promises[i + 1] = promises[i].then(thens[i]);
}
}
promises[i].then(resolve, reject, notify);
}, function () {
var i;
for (i = 0; i < promises.length; i += 1) {
promises[i].cancel();
}
});
}
function unexpectedError(error) { function unexpectedError(error) {
if (error instanceof Error) { if (error instanceof Error) {
deepEqual([ deepEqual([
......
...@@ -68,8 +68,9 @@ ...@@ -68,8 +68,9 @@
"status": 204, "status": 204,
"statusText": "No Content" "statusText": "No Content"
}, "Post a new document"); }, "Post a new document");
ok(/^no_document_id_[0-9]+$/.test(uuid), "New document id should look like " + ok(/^no_document_id_[0-9]+$/.test(uuid),
"no_document_id_479658600408584 : " + uuid); "New document id should look like no_document_id_479658600408584 : " +
uuid);
shared.created_document_id = uuid; shared.created_document_id = uuid;
} }
...@@ -118,7 +119,7 @@ ...@@ -118,7 +119,7 @@
//quelle utilité à pousser le xml ? //quelle utilité à pousser le xml ?
responses.push([ responses.push([
200, 200,
{"Content-Type": "text/xml"},'' {"Content-Type": "text/xml"}, ''
]); // PROPFIND ]); // PROPFIND
return jio.allDocs(); return jio.allDocs();
} }
...@@ -294,7 +295,7 @@ ...@@ -294,7 +295,7 @@
function createAttachmentTest(answer) { function createAttachmentTest(answer) {
deepEqual(answer, { deepEqual(answer, {
"attachment": "aa", "attachment": "aa",
"digest":"sha256-9834876dcfb05cb167a5c24953eba58c4"+ "digest": "sha256-9834876dcfb05cb167a5c24953eba58c4" +
"ac89b1adf57f28f2f9d09af107ee8f0", "ac89b1adf57f28f2f9d09af107ee8f0",
"id": "a", "id": "a",
"method": "putAttachment", "method": "putAttachment",
...@@ -313,7 +314,7 @@ ...@@ -313,7 +314,7 @@
"_attachments": { "_attachments": {
"aa": { "aa": {
"content_type": "text/plain", "content_type": "text/plain",
"digest": "sha256-38760eabb666e8e61ee628a17c4090cc5"+ "digest": "sha256-38760eabb666e8e61ee628a17c4090cc5" +
"0728e095ff24218119d51bd22475363", "0728e095ff24218119d51bd22475363",
"length": 3 "length": 3
} }
...@@ -332,7 +333,7 @@ ...@@ -332,7 +333,7 @@
function updateAttachmentTest(answer) { function updateAttachmentTest(answer) {
deepEqual(answer, { deepEqual(answer, {
"attachment": "aa", "attachment": "aa",
"digest": "sha256-38760eabb666e8e61ee628a17c4090cc5"+ "digest": "sha256-38760eabb666e8e61ee628a17c4090cc5" +
"0728e095ff24218119d51bd22475363", "0728e095ff24218119d51bd22475363",
"id": "a", "id": "a",
"method": "putAttachment", "method": "putAttachment",
...@@ -351,7 +352,7 @@ ...@@ -351,7 +352,7 @@
"_attachments": { "_attachments": {
"aa": { "aa": {
"content_type": "text/plain", "content_type": "text/plain",
"digest": "sha256-38760eabb666e8e61ee628a17c4090cc5"+ "digest": "sha256-38760eabb666e8e61ee628a17c4090cc5" +
"0728e095ff24218119d51bd22475363", "0728e095ff24218119d51bd22475363",
"length": 3 "length": 3
} }
...@@ -389,7 +390,7 @@ ...@@ -389,7 +390,7 @@
"_attachments": { "_attachments": {
"aa": { "aa": {
"content_type": "text/plain", "content_type": "text/plain",
"digest": "sha256-38760eabb666e8e61ee628a17c4090cc5"+ "digest": "sha256-38760eabb666e8e61ee628a17c4090cc5" +
"0728e095ff24218119d51bd22475363", "0728e095ff24218119d51bd22475363",
"length": 3 "length": 3
}, },
...@@ -424,7 +425,7 @@ ...@@ -424,7 +425,7 @@
"_attachments": { "_attachments": {
"aa": { "aa": {
"content_type": "text/plain", "content_type": "text/plain",
"digest": "sha256-38760eabb666e8e61ee628a17c4090cc5"+ "digest": "sha256-38760eabb666e8e61ee628a17c4090cc5" +
"0728e095ff24218119d51bd22475363", "0728e095ff24218119d51bd22475363",
"length": 3 "length": 3
}, },
...@@ -448,7 +449,7 @@ ...@@ -448,7 +449,7 @@
deepEqual(answer, { deepEqual(answer, {
"attachment": "aa", "attachment": "aa",
"data": "<blob>", "data": "<blob>",
"digest": "sha256-38760eabb666e8e61ee628a17c4090cc5"+ "digest": "sha256-38760eabb666e8e61ee628a17c4090cc5" +
"0728e095ff24218119d51bd22475363", "0728e095ff24218119d51bd22475363",
"id": "a", "id": "a",
"method": "getAttachment", "method": "getAttachment",
...@@ -473,7 +474,7 @@ ...@@ -473,7 +474,7 @@
"_attachments": { "_attachments": {
"aa": { "aa": {
"content_type": "text/plain", "content_type": "text/plain",
"digest": "sha256-38760eabb666e8e61ee628a17c4090cc5"+ "digest": "sha256-38760eabb666e8e61ee628a17c4090cc5" +
"0728e095ff24218119d51bd22475363", "0728e095ff24218119d51bd22475363",
"length": 3 "length": 3
}, },
...@@ -522,7 +523,7 @@ ...@@ -522,7 +523,7 @@
"_attachments": { "_attachments": {
"aa": { "aa": {
"content_type": "text/plain", "content_type": "text/plain",
"digest": "sha256-38760eabb666e8e61ee628a17c4090cc5"+ "digest": "sha256-38760eabb666e8e61ee628a17c4090cc5" +
"0728e095ff24218119d51bd22475363", "0728e095ff24218119d51bd22475363",
"length": 3 "length": 3
}, },
...@@ -545,7 +546,7 @@ ...@@ -545,7 +546,7 @@
"_attachments": { "_attachments": {
"aa": { "aa": {
"content_type": "text/plain", "content_type": "text/plain",
"digest": "sha256-38760eabb666e8e61ee628a17c4090cc5"+ "digest": "sha256-38760eabb666e8e61ee628a17c4090cc5" +
"0728e095ff24218119d51bd22475363", "0728e095ff24218119d51bd22475363",
"length": 3 "length": 3
}, },
...@@ -574,7 +575,7 @@ ...@@ -574,7 +575,7 @@
"_attachments": { "_attachments": {
"aa": { "aa": {
"content_type": "text/plain", "content_type": "text/plain",
"digest": "sha256-38760eabb666e8e61ee628a17c4090cc5"+ "digest": "sha256-38760eabb666e8e61ee628a17c4090cc5" +
"0728e095ff24218119d51bd22475363", "0728e095ff24218119d51bd22475363",
"length": 3 "length": 3
}, },
...@@ -611,7 +612,7 @@ ...@@ -611,7 +612,7 @@
"_attachments": { "_attachments": {
"aa": { "aa": {
"content_type": "text/plain", "content_type": "text/plain",
"digest": "sha256-38760eabb666e8e61ee628a17c4090cc5"+ "digest": "sha256-38760eabb666e8e61ee628a17c4090cc5" +
"0728e095ff24218119d51bd22475363", "0728e095ff24218119d51bd22475363",
"length": 3 "length": 3
} }
......
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