• R/O
  • HTTP
  • SSH
  • HTTPS

zephyr: Commit

This repository is for zephyr, which is implemented for a GUI of Eos.


Commit MetaInfo

Revision8ba3799025ecb08cb7834922b2e88d13881f4885 (tree)
Time2016-02-03 13:08:37
Authorhimetani_cafe <fumifumi@yasu...>
Commiterhimetani_cafe

Log Message

[TMP]REST APIのテストコード

Change Summary

Incremental Difference

--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
44 "description": "",
55 "main": "./server/app.js",
66 "scripts": {
7- "test": "mocha test/mocha/*.test.js"
7+ "test": "node test/rest/execution.test.js"
88 },
99 "author": "",
1010 "license": "ISC",
--- a/server/api/v1/execution/index.js
+++ b/server/api/v1/execution/index.js
@@ -9,7 +9,7 @@ var eos = require(__dirname + '/../../../../server/class/Eos').instance;
99
1010 router.post('/', function(req, res) {
1111 console.log(req.body);
12- res.send('/api/v1/execution');
12+ res.send(req.body);
1313 });
1414
1515 module.exports = router;
--- a/test/rest/execution.test.js
+++ b/test/rest/execution.test.js
@@ -8,14 +8,15 @@ request({
88 multipart: [
99 {
1010 'content-type': 'application/json',
11- body: JSON.stringify({foo: 'bar', greeting: 'hello'})
11+ body: JSON.stringify({command: 'bar', arguments: [{name: '-r', arguments: [1,2,3]}, { name: '-i', arguments: ['file1.txt']}, { name: '-o', arguments: ['file1.txt']} ]})
1212 },
1313 { body: 'I am an attachment' }
1414 ],
1515 },
16-function(error, resopnse, body) {
16+function(error, response, body) {
1717 if(error) {
1818 return console.error('upload failed:', error);
1919 }
20- console.log(body);
20+ console.log("OK");
21+ //console.log(response);
2122 });
Show on old repository browser