Skip to content

Commit

Permalink
Tests: eliminate need for requiring mock-firmata from within board.js
Browse files Browse the repository at this point in the history
Relevant to gh-1101

Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
  • Loading branch information
rwaldron committed Apr 13, 2016
1 parent 7a2696f commit 624dc7a
Show file tree
Hide file tree
Showing 56 changed files with 1,010 additions and 2,480 deletions.
3 changes: 2 additions & 1 deletion .jshintrc
Expand Up @@ -21,6 +21,7 @@
"Radar": true, "Radar": true,
"WeakMap": true, "WeakMap": true,
"window": true, "window": true,
"copy": true "copy": true,
"mocks": true
} }
} }
4 changes: 2 additions & 2 deletions Gruntfile.js
Expand Up @@ -75,7 +75,7 @@ module.exports = function(grunt) {
}, },
nodeunit: { nodeunit: {
tests: [ tests: [
"test/bootstrap/*.js", "test/common/bootstrap.js",
"test/*.js" "test/*.js"
] ]
}, },
Expand Down Expand Up @@ -149,7 +149,7 @@ module.exports = function(grunt) {
grunt.registerTask("nodeunit:just", "Run a single or limited set of tests specified by a target; usage: 'grunt nodeunit:just:test-file' or 'grunt nodeunit:just:{test-file-a,test-file-b}'", function(file) { grunt.registerTask("nodeunit:just", "Run a single or limited set of tests specified by a target; usage: 'grunt nodeunit:just:test-file' or 'grunt nodeunit:just:{test-file-a,test-file-b}'", function(file) {


var config = [ var config = [
"test/bootstrap/*.js", "test/common/bootstrap.js",
]; ];


if (file) { if (file) {
Expand Down
4 changes: 1 addition & 3 deletions lib/board.js
Expand Up @@ -71,9 +71,7 @@ var Serial = {


var serialport; var serialport;


if (IS_TEST_MODE) { if (parseFloat(process.versions.nw) >= 0.13) {
serialport = require("mock-firmata").SerialPort;
} else if (parseFloat(process.versions.nw) >= 0.13) {
serialport = require("browser-serialport"); serialport = require("browser-serialport");
} else { } else {
serialport = require("serialport"); serialport = require("serialport");
Expand Down
87 changes: 87 additions & 0 deletions test/.jshintrc
@@ -0,0 +1,87 @@
{
"curly": true,
"eqeqeq": true,
"immed": true,
"latedef": false,
"newcap": false,
"noarg": true,
"sub": true,
"undef": true,
"boss": true,
"eqnull": true,
"node": true,
"strict": false,
"esnext": true,
"quotmark": "double",
"unused": true,
"globals": {
"exports": true,
"document": true,
"$": true,
"Radar": true,
"WeakMap": true,
"window": true,
"copy": true,
"sinon": true,
"newBoard": true,
"mocks": true,
"Firmata": true,
"MockFirmata": true,
"SerialPort": true,
"MockSerialPort": true,
"five": true,
"Accelerometer": true,
"Animation": true,
"Altimeter": true,
"Barometer": true,
"Board": true,
"Boards": true,
"Button": true,
"Buttons": true,
"Color": true,
"Compass": true,
"Distance": true,
"ESC": true,
"ESCs": true,
"Expander": true,
"Fn": true,
"GPS": true,
"Gripper": true,
"Gyro": true,
"Hygrometer": true,
"IMU": true,
"IR": true,
"Keypad": true,
"LCD": true,
"Led": true,
"Leds": true,
"LedControl": true,
"Light": true,
"Joystick": true,
"Motion": true,
"Motor": true,
"Nodebot": true,
"Piezo": true,
"Ping": true,
"Pir": true,
"Pin": true,
"Proximity": true,
"Relay": true,
"Repl": true,
"Sensor": true,
"Sensors": true,
"Servo": true,
"Servos": true,
"ShiftRegister": true,
"ShiftRegisters": true,
"Sonar": true,
"Stepper": true,
"Switch": true,
"Thermometer": true,
"Virtual": true,
"Wii": true,
"Collection": true,
"Emitter": true,
"within": true
}
}

0 comments on commit 624dc7a

Please sign in to comment.