Skip to content

Commit

Permalink
Merge pull request octalmage#20 from DamonOehlman/testing
Browse files Browse the repository at this point in the history
Testing.
  • Loading branch information
octalmage committed Apr 10, 2015
2 parents aca285b + 779d238 commit 459085f
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
sudo: false
language: node_js
node_js:
- 0.10
- 0.12
- iojs

addons:
apt:
packages:
- libx11-dev
- zlib1g-dev
- libpng12-dev
- libxtst-dev

before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Node.js GUI Automation.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"test": "node test/all.js",
"install": "node-gyp rebuild"
},
"repository": {
Expand All @@ -29,5 +29,8 @@
"homepage": "https://github.com/octalmage/robotjs",
"dependencies": {
"nan": "^1.3.0"
},
"devDependencies": {
"tape": "^3.5.0"
}
}
1 change: 1 addition & 0 deletions test/all.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require('./mouse');
10 changes: 10 additions & 0 deletions test/mouse.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
var test = require('tape');
var robot = require('..');
var lastKnownPos;

test('get the initial mouse position', function(t) {
t.plan(3);
t.ok(lastKnownPos = robot.getMousePos(), 'successfully retrieved mouse position');
t.ok(lastKnownPos.x !== undefined, 'mousepos.x is a valid value');
t.ok(lastKnownPos.y !== undefined, 'mousepos.y is a valid value');
});

0 comments on commit 459085f

Please sign in to comment.