Skip to content

Commit

Permalink
Merge pull request #1 from rjz/fix/testing
Browse files Browse the repository at this point in the history
Testing fixes
  • Loading branch information
rjz committed May 23, 2016
2 parents 6abcd33 + ddda269 commit 632d65f
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 10 deletions.
8 changes: 8 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"indent": 2,
"strict": true,
"node": true,
"undef": true,
"unused": true,
"maxcomplexity": 5
}
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@ env:

before_script: ./tasks/travis_before_script.sh

script:
- npm run coverage

after_script:
- cat coverage/lcov.info | coveralls
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
Twitter Intent
===============================================================================

[![Build
Status](https://travis-ci.org/rjz/twitter-intent.svg?branch=master)](https://travis-ci.org/rjz/twitter-intent)
[![Build Status](https://travis-ci.org/rjz/twitter-intent.svg?branch=master)](https://travis-ci.org/rjz/twitter-intent)
[![Coverage Status](https://coveralls.io/repos/github/rjz/twitter-intent/badge.svg?branch=master)](https://coveralls.io/github/rjz/twitter-intent?branch=master)


A utility for building [twitter intents](https://dev.twitter.com/web/intents)

Example
-------------------------------------------------------------------------------

var twitterIntent = require('twitter-intent');
var href = twitterIntent.tweet.url({
text: 'Tweet me!',
hashtag: ['node.js', 'npm']
});
```js
var twitterIntent = require('twitter-intent');
var href = twitterIntent.tweet.url({
text: 'Tweet me!',
hashtag: ['node.js', 'npm']
});

console.log('<a href="' + href + '">Click me!</a>');
console.log('<a href="' + href + '">Click me!</a>');
```

Installation
-------------------------------------------------------------------------------
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
"description": "Utilities for building twitter intents",
"main": "index.js",
"scripts": {
"lint": "jshint .",
"pretest": "npm run lint",
"test": "mocha",
"lint": "jshint"
"coverage": "istanbul cover _mocha ./test"
},
"repository": {
"type": "git",
Expand All @@ -20,6 +21,8 @@
},
"dependencies": {},
"devDependencies": {
"coveralls": "~2.11.9",
"istanbul": "~0.4.3",
"jshint": "~2.5.2",
"mocha": "~1.13.0"
}
Expand Down
4 changes: 3 additions & 1 deletion src/endpoint.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

function partial (fn) {
var args = [].slice.call(arguments, 1);
return function () {
Expand Down Expand Up @@ -50,7 +52,7 @@ function qsFactory (ALLOWED_PARAMS, params) {
}
});
return formatted.join('&');
};
}

module.exports = function endpoint (path, validParams) {
var url = 'https://twitter.com/intent' + path;
Expand Down
4 changes: 4 additions & 0 deletions test/spec.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* globals describe, it: false */

'use strict';

var assert = require('assert');

var intent = require('../index');
Expand Down

0 comments on commit 632d65f

Please sign in to comment.