Permalink
Browse files

Add simple tests, update package.json and jshintrc for mocha

  • Loading branch information...
dconnolly committed May 12, 2014
1 parent 8d5cb2c commit 2cd7aad4cc52eb6d4f6991461326272d21ecdb5b
Showing with 71 additions and 42 deletions.
  1. +9 −0 .jshintrc
  2. +45 −42 package.json
  3. +17 −0 test.js
@@ -1,4 +1,13 @@
{
"globals" : {
/* MOCHA */
"describe" : false,
"it" : false,
"before" : false,
"beforeEach" : false,
"after" : false,
"afterEach" : false
},
"node": true,
"esnext": true,
"bitwise": true,
@@ -1,44 +1,47 @@
{
"name": "chromecast-backgrounds",
"version": "0.2.0",
"description": "Get all those beautiful backgrounds images from the Chromecast home view.",
"license": "MIT",
"bin": {
"chromecast-backgrounds": "cli.js"
},
"repository": "dconnolly/chromecast-backgrounds",
"author": {
"name": "Deirdre Connolly",
"email": "durumcrustulum@gmail.com"
},
"engines": {
"node": ">=0.10.0"
},
"scripts": {},
"files": [
"index.js",
"cli.js"
],
"keywords": [
"chromecast",
"backgrounds",
"images",
"chrome",
"cli"
],
"devDependencies": {
"grunt-contrib-jshint": "~0.7.0",
"grunt-contrib-nodeunit": "~0.2.0",
"grunt-contrib-watch": "~0.5.0",
"load-grunt-tasks": "~0.2.0",
"time-grunt": "~0.2.0",
"jshint-stylish": "~0.1.3"
},
"dependencies": {
"request": "~2.33.0",
"lodash": "~2.4.1",
"q": "~1.0.0",
"nopt": "~2.2.0",
"chalk": "~0.4.0"
}
"name": "chromecast-backgrounds",
"version": "0.2.0",
"description": "Get all those beautiful backgrounds images from the Chromecast home view.",
"license": "MIT",
"bin": {
"chromecast-backgrounds": "cli.js"
},
"repository": "dconnolly/chromecast-backgrounds",
"author": {
"name": "Deirdre Connolly",
"email": "durumcrustulum@gmail.com"
},
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"test": "mocha test.js"
},
"files": [
"index.js",
"cli.js"
],
"keywords": [
"chromecast",
"backgrounds",
"images",
"chrome",
"cli"
],
"devDependencies": {
"grunt-contrib-jshint": "~0.7.0",
"grunt-contrib-nodeunit": "~0.2.0",
"grunt-contrib-watch": "~0.5.0",
"load-grunt-tasks": "~0.2.0",
"time-grunt": "~0.2.0",
"jshint-stylish": "~0.1.3",
"mocha": "~1.18.2"
},
"dependencies": {
"request": "~2.33.0",
"lodash": "~2.4.1",
"q": "~1.0.0",
"nopt": "~2.2.0",
"chalk": "~0.4.0"
}
}
17 test.js
@@ -0,0 +1,17 @@
'use strict';

var assert = require('assert');
var _ = require('lodash');
var getChromecastBackgrounds = require('./index');

it('should get some background objects', function(cb) {
getChromecastBackgrounds().then(function (backgrounds) {
console.log(backgrounds);
assert(backgrounds);
var background = backgrounds[0];
assert(_.has(background, 'url', 'author'));
assert(background.url.indexOf('googleusercontent') > 0);
cb();
});

});

0 comments on commit 2cd7aad

Please sign in to comment.