소스 검색

Merge pull request #13 from thingsSDK/test-setup

Test setup
Andrew Chalkley 9 년 전
부모
커밋
f6258a5c74
4개의 변경된 파일23개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 0
      .travis.yml
  2. 1 0
      README.md
  3. 5 2
      package.json
  4. 14 0
      test/rom_comm_test.js

+ 3 - 0
.travis.yml

@@ -0,0 +1,3 @@
+language: node_js
+node_js:
+    - "5"

+ 1 - 0
README.md

@@ -1,4 +1,5 @@
 # Flasher.js
+[![Build Status](https://api.travis-ci.org/thingsSDK/flasher.js.svg)](https://travis-ci.org/thingsSDK/flasher.js)
 
 _Flasher.js_ is a tool to get JavaScript running natively on
 the Internet of Things device, ESP8266. This application runs on

+ 5 - 2
package.json

@@ -4,7 +4,8 @@
   "description": "A GUI tool for flashing the Espruino JavaScript runtime on Adafruit Huzzah (ESP8366 based) boards",
   "main": "index.js",
   "scripts": {
-    "start": "electron index.js"
+    "start": "electron index.js",
+    "test": "mocha"
   },
   "repository": {
     "type": "git",
@@ -32,6 +33,8 @@
     "unzip": "^0.1.11"
   },
   "devDependencies": {
-    "electron-prebuilt": "^0.36.9"
+    "chai": "^3.5.0",
+    "electron-prebuilt": "^0.36.9",
+    "mocha": "^2.4.5"
   }
 }

+ 14 - 0
test/rom_comm_test.js

@@ -0,0 +1,14 @@
+'use strict';
+
+const expect = require('chai').expect;
+const RomComm = require('../back-end/rom_comm');
+
+describe('ESP8266', () => {
+    const boards = require('../back-end/boards');
+    it('defaults to the Esp12', () => {
+        var esp = new RomComm({
+            portName: 'TEST'
+        });
+        expect(esp.board).to.be.an.instanceof(boards.Esp12);
+    });
+});