OSDN Git Service

Arranged Test environment.
[eos/zephyr.git] / test / mocha / Eos.test.js
diff --git a/test/mocha/Eos.test.js b/test/mocha/Eos.test.js
new file mode 100644 (file)
index 0000000..c2477d3
--- /dev/null
@@ -0,0 +1,31 @@
+var Eos = require('../../server/class/Eos');
+var expect = require('chai').expect;
+
+var test1 = `
+    /**
+     * Eosコマンドをエミュレートするクラス 
+     *
+     * @param {string} Eosコマンドの名前
+     * @param {Array<Object>} コマンドに渡すオプション
+     * @returns 
+     * function execute(command, params) {
+     */
+    
+`;
+
+describe(/*execute()*/test1, function() {
+    describe('#1: check whether command is valid or not', function() {
+        it('should return false when the command is typeof number.', function() {
+            const eos = new Eos();
+            const result = eos.execute(2);
+            expect(result.hasDone).to.equal(false);
+        });
+
+        it('should return false when command name is invalid', function() {
+            const eos = new Eos();
+            const result = eos.execute('hoge');
+            expect(result.hasDone).to.equal(false);
+        });
+
+    });
+});