Skip to content

Commit

Permalink
Add JSHint, Mocha and Travis
Browse files Browse the repository at this point in the history
  • Loading branch information
zenorocha committed Sep 19, 2013
1 parent dcdfd8e commit f275d4b
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 4 deletions.
51 changes: 51 additions & 0 deletions .jshintrc
@@ -0,0 +1,51 @@
{
"asi": false,
"bitwise": true,
"boss": true,
"browser": true,
"curly": true,
"debug": false,
"eqeqeq": true,
"eqnull": false,
"es5": false,
"esnext": false,
"evil": false,
"expr": true,
"forin": true,
"funcscope": false,
"globals": {
"describe": true,
"it": true
},
"globalstrict": false,
"immed": true,
"iterator": false,
"lastsemic": false,
"latedef": true,
"laxbreak": false,
"laxcomma": false,
"loopfunc": false,
"maxerr": 10000,
"maxlen": 180,
"multistr": false,
"newcap": true,
"noarg": true,
"node": true,
"noempty": true,
"nomen": false,
"onevar": true,
"passfail": false,
"plusplus": false,
"proto": false,
"quotmark": "single",
"scripturl": true,
"shadow": false,
"smarttabs": false,
"strict": false,
"sub": false,
"supernew": false,
"trailing": true,
"undef": true,
"unused": true,
"white": false
}
6 changes: 6 additions & 0 deletions .travis.yml
@@ -0,0 +1,6 @@
language: node_js
node_js:
- 0.8
- 0.10
before_script:
- npm run-script lint
18 changes: 17 additions & 1 deletion README.md
@@ -1,4 +1,4 @@
# GH Gif [![NPM version](https://badge.fury.io/js/gh-gif.png)](http://badge.fury.io/js/gh-gif) [![Dependency Status](https://david-dm.org/node-gh/gh-gif.png)](https://david-dm.org/node-gh/gh-gif)
# GH Gif [![Build Status](https://secure.travis-ci.org/node-gh/gh-flow.png?branch=master)](https://travis-ci.org/node-gh/gh-flow) [![NPM version](https://badge.fury.io/js/gh-flow.png)](http://badge.fury.io/js/gh-flow) [![Dependency Status](https://david-dm.org/node-gh/gh-flow.png)](https://david-dm.org/node-gh/gh-flow)

![DaftPunktocat](http://zno.io/RMu9/daftpunktocat.gif)

Expand Down Expand Up @@ -46,6 +46,22 @@ gh gif 75 --reaction surprised --user node-gh --repo gh-gif
gh gif 75 --image http://media1.giphy.com/media/5DQdk5oZzNgGc/original.gif
```

## Testing

Check [Travis](https://travis-ci.org/node-gh/gh-gif) for continous integration results.

* Run [JSHint](http://www.jshint.com/), a tool to detect errors and potential problems.

```
npm run-script lint
```

* Run [Mocha](http://visionmedia.github.io/mocha/), a unit test framework.

```
npm run-script test
```

## Contributing

1. Fork it!
Expand Down
15 changes: 12 additions & 3 deletions package.json
Expand Up @@ -5,7 +5,8 @@
"author": {
"name": "Zeno Rocha",
"email": "hi@zenorocha.com",
"web": "http://zenorocha.com"
"web": "http://zenorocha.com",
"twitter": "zenorocha"
},
"contributors": [{
"name": "Eduardo Lundgren",
Expand All @@ -27,15 +28,23 @@
"bin": {
"gh-gif": "bin/gif.js"
},
"engines": {
"node": ">=0.8"
"scripts": {
"lint": "node_modules/.bin/jshint bin/ test/",
"test": "node_modules/.bin/mocha --reporter list"
},
"dependencies": {
"async": "0.2.9",
"giphy-wrapper": "0.0.1"
},
"devDependencies": {
"jshint": "2.1.2",
"mocha": "1.12.0"
},
"peerDependencies": {
"gh": ">=1.4.0"
},
"engines": {
"node": ">=0.8"
},
"preferGlobal": "true"
}
19 changes: 19 additions & 0 deletions test/gif.js
@@ -0,0 +1,19 @@
/*
* Copyright 2013, All Rights Reserved.
*
* Code licensed under the BSD License:
* https://github.com/node-gh/gh/blob/master/LICENSE.md
*
* @author Zeno Rocha <hi@zenorocha.com>
*/

// -- Requires -----------------------------------------------------------------
var assert = require('assert');

// -- Suites -------------------------------------------------------------------
describe('A test suite', function() {
it('should return a hello world message', function(){
var hello = 'Hello world :)';
assert.equal('Hello world :)', hello);
});
});

0 comments on commit f275d4b

Please sign in to comment.