FileAPI
FileAPI copied to clipboard
Allow all 2xx codes
All 2xx codes would be treated as the success one
@RubaXa а что с тестовой картинкой?
Running "curl:jpg" (curl) task
Verifying property curl.jpg exists in config...OK
Files: [no src] -> tests/files/big.jpg
Warning: Fetching "https://dl.dropboxusercontent.com/u/49592745/BigJPG.jpg" failed with HTTP status code 404 Use --force to continue.
Aborted due to warnings.
npm ERR! Test failed. See above for more details.
The command "npm test" exited with 1.
@ogonkov да, с картинкой какая-то лажа произошла, в субботу буду разбираться.
@ogonkov готово, файл вернули, влейте актуальный мастер.
Тесты не знаю куда воткнуть, открыл файл с тестами, испугался и закрыл
А в чём проблема?
Нужно сделать подобное:
test('upload file', function (){
stop();
FileAPI.upload({
url: controllerUrl,
files: { text: FileAPI.getFiles(uploadForm['hello.txt']) },
data: {allowedStatus: 232},
complete: function (err, res, xhr) {
start();
// тут проверяем статус xhr
}
});
});
Тут нужна обработка allowedStatus
https://github.com/mailru/FileAPI/blob/master/node/server.js#L29-L47
ok, завтра гляну подробнее