diff --git a/.jshintrc b/.jshintrc index dfd08b60..f12c6705 100644 --- a/.jshintrc +++ b/.jshintrc @@ -25,6 +25,6 @@ "trailing": true, "quotmark": "single", "proto": true, - "laxbreak": true + "laxbreak": true, + "mocha": true } - diff --git a/Gruntfile.js b/Gruntfile.js index 0ed1ee85..d4ae0cc3 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -14,7 +14,8 @@ module.exports = function(grunt) { }, files: [ 'Gruntfile.js', - './build/ros3d.js' + './build/ros3d.js', + './tests/*.js' ] }, karma: { diff --git a/README.md b/README.md index 2592cf24..a6465554 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ros3djs [](h ======= #### 3D Visualization Library for use with the ROS JavaScript Libraries -For full documentation, see [the ROS wiki](http://ros.org/wiki/ros3djs) or check out some [working demos](http://robotwebtools.org/). +For full documentation, see [the ROS wiki](http://ros.org/wiki/ros3djs) or check out some [working demos](http://robotwebtools.org/demos.html). [JSDoc](http://robotwebtools.org/jsdoc/ros3djs/current/) can be found on the Robot Web Tools website. @@ -89,6 +89,11 @@ To run the build tasks: `grunt doc` will rebuild all JSDoc for the project. +### Testing +Utilizes [mocha](https://mochajs.org/) and [chai](http://chaijs.com/) for in browser testing. + +To run tests simply open `tests/index.html` in a web browser + ### License ros3djs is released with a BSD license. For full terms and conditions, see the [LICENSE](LICENSE) file. diff --git a/package.json b/package.json index 6d7fafe7..fa5f8a75 100644 --- a/package.json +++ b/package.json @@ -6,14 +6,16 @@ "license": "BSD-3-Clause", "main": "./src/Ros3D.js", "devDependencies": { + "chai": "^3.5.0", "grunt": "~1.0.1", + "grunt-contrib-clean": "~1.0.0", "grunt-contrib-concat": "~1.0.1", "grunt-contrib-jshint": "~1.1.0", - "grunt-karma": "~2.0.0", - "grunt-contrib-watch": "~1.0.0", "grunt-contrib-uglify": "~2.0.0", + "grunt-contrib-watch": "~1.0.0", "grunt-jsdoc": "~2.1.0", - "grunt-contrib-clean": "~1.0.0" + "grunt-karma": "~2.0.0", + "mocha": "^3.2.0" }, "repository": { "type": "git", diff --git a/tests/index.html b/tests/index.html new file mode 100644 index 00000000..e5ce7db7 --- /dev/null +++ b/tests/index.html @@ -0,0 +1,25 @@ + + +
+ +ros3d.js Tests