Skip to content

Commit

Permalink
Merge branch 'Hypercubed-update-deps'
Browse files Browse the repository at this point in the history
  • Loading branch information
Hypercubed committed Oct 9, 2016
2 parents 9dbc051 + 80e964d commit 66e981e
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 81 deletions.
8 changes: 6 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"ecmaFeatures": {
"modules": true
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"modules": true
}
},
"rules": {
"indent": [
Expand Down
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
language: node_js
node_js:
- "0.10"
- "0.12"
- "4"
- "6"

branches:
only:
Expand Down
6 changes: 3 additions & 3 deletions index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ test.cb( 'credits - folder exists', t => {

credits( path )
.then( credits => {
t.same( credits.npm[ 0 ].name, 'Bob Calsow' );
t.same( credits.npm[ 0 ].packages, [ 'foo' ] );
t.deepEqual( credits.npm[ 0 ].name, 'Bob Calsow' );
t.deepEqual( credits.npm[ 0 ].packages, [ 'foo' ] );

cleanUpCb();

Expand All @@ -30,7 +30,7 @@ test.cb( 'credits - folder exists', t => {
test.cb( 'credits - folder does not exist', t => {
credits( '/path/that/does/not/exist' )
.catch( error => {
t.same( error.message, '/path/that/does/not/exist does not exist' );
t.deepEqual( error.message, '/path/that/does/not/exist does not exist' );
t.end();
} );
} );
10 changes: 5 additions & 5 deletions lib/analyzers/bower/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ test.cb( 'getCredits - get availalbe bower credits', t => {

let credits = getCredits( path );

t.same( credits[ 0 ].name, 'Alice Bobson' );
t.same( credits[ 0 ].email, 'alicebobson@alison.io' );
t.same( credits[ 0 ].packages, [ 'bar' ] );
t.deepEqual( credits[ 0 ].name, 'Alice Bobson' );
t.deepEqual( credits[ 0 ].email, 'alicebobson@alison.io' );
t.deepEqual( credits[ 0 ].packages, [ 'bar' ] );

t.same( credits[ 1 ].name, 'Bob Calsow' );
t.same( credits[ 1 ].packages, [ 'foo' ] );
t.deepEqual( credits[ 1 ].name, 'Bob Calsow' );
t.deepEqual( credits[ 1 ].packages, [ 'foo' ] );

cleanUpCb();

Expand Down
26 changes: 13 additions & 13 deletions lib/analyzers/jspm/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,24 +52,24 @@ test.cb( 'getCredits - get availalbe jspm credits', t => {

let credits = getCredits( path );

t.same( credits[ 0 ].name, 'Alice Bobson' );
t.same( credits[ 0 ].packages, [ 'baz' ] );
t.deepEqual( credits[ 0 ].name, 'Alice Bobson' );
t.deepEqual( credits[ 0 ].packages, [ 'baz' ] );

t.same( credits[ 1 ].name, 'Randy Ran' );
t.same( credits[ 1 ].packages, [ 'baz' ] );
t.deepEqual( credits[ 1 ].name, 'Randy Ran' );
t.deepEqual( credits[ 1 ].packages, [ 'baz' ] );

t.same( credits[ 2 ].name, 'Bobby Bob' );
t.same( credits[ 2 ].email, 'bobby@bob.io' );
t.same( credits[ 2 ].packages, [ 'baz' ] );
t.deepEqual( credits[ 2 ].name, 'Bobby Bob' );
t.deepEqual( credits[ 2 ].email, 'bobby@bob.io' );
t.deepEqual( credits[ 2 ].packages, [ 'baz' ] );

t.same( credits[ 3 ].name, 'Bob Calsow' );
t.same( credits[ 3 ].packages, [ 'boing' ] );
t.deepEqual( credits[ 3 ].name, 'Bob Calsow' );
t.deepEqual( credits[ 3 ].packages, [ 'boing' ] );

t.same( credits[ 4 ].name, 'Janice Robson' );
t.same( credits[ 4 ].packages, [ 'boo' ] );
t.deepEqual( credits[ 4 ].name, 'Janice Robson' );
t.deepEqual( credits[ 4 ].packages, [ 'boo' ] );

t.same( credits[ 5 ].name, 'Don Calsow' );
t.same( credits[ 5 ].packages, [ 'foo' ] );
t.deepEqual( credits[ 5 ].name, 'Don Calsow' );
t.deepEqual( credits[ 5 ].packages, [ 'foo' ] );

cleanUpCb();

Expand Down
20 changes: 10 additions & 10 deletions lib/analyzers/npm/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,20 @@ test.cb( 'getCredits - get availalbe npm credits', t => {

let credits = getCredits( path );

t.same( credits[ 0 ].name, 'Alice Bobson' );
t.same( credits[ 0 ].packages, [ 'bar', 'boom', 'baz' ] );
t.deepEqual( credits[ 0 ].name, 'Alice Bobson' );
t.deepEqual( credits[ 0 ].packages, [ 'bar', 'boom', 'baz' ] );

t.same( credits[ 1 ].name, 'Randy Ran' );
t.same( credits[ 1 ].packages, [ 'baz' ] );
t.deepEqual( credits[ 1 ].name, 'Randy Ran' );
t.deepEqual( credits[ 1 ].packages, [ 'baz' ] );

t.same( credits[ 2 ].name, 'Bobby Bob' );
t.same( credits[ 2 ].packages, [ 'baz' ] );
t.deepEqual( credits[ 2 ].name, 'Bobby Bob' );
t.deepEqual( credits[ 2 ].packages, [ 'baz' ] );

t.same( credits[ 3 ].name, 'Bob Calsow' );
t.same( credits[ 3 ].packages, [ 'boing', 'foo' ] );
t.deepEqual( credits[ 3 ].name, 'Bob Calsow' );
t.deepEqual( credits[ 3 ].packages, [ 'boing', 'foo' ] );

t.same( credits[ 4 ].name, 'Bob Loblaw' );
t.same( credits[ 4 ].packages, [ 'cycle', 'linked' ] );
t.deepEqual( credits[ 4 ].name, 'Bob Loblaw' );
t.deepEqual( credits[ 4 ].packages, [ 'cycle', 'linked' ] );

cleanUpCb();

Expand Down
10 changes: 5 additions & 5 deletions package.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "index.js",
"scripts": {
"lint": "eslint *.js util/* lib/*",
"test": "npm run lint && nyc ava *.spec.js ./**/*.spec.js ./lib/**/*.spec.js",
"test": "npm run lint && nyc ava *.spec.js ./util/*.spec.js ./lib/**/*.spec.js",
"coveralls": "nyc report --reporter=text-lcov | coveralls"
},
"repository": {
Expand All @@ -19,15 +19,15 @@
},
"homepage": "https://github.com/stefanjudis/credits#readme",
"devDependencies": {
"ava": "^0.11.0",
"ava": "^0.16.0",
"coveralls": "^2.11.4",
"eslint": "^1.7.3",
"eslint": "^3.7.1",
"nyc": "^8.3.1",
"tmp": "0.0.28"
"tmp": "0.0.29"
},
"dependencies": {
"all-stars": "^1.1.0",
"es6-promise": "^3.0.2",
"es6-promise": "^4.0.5",
"object-assign": "^4.0.1"
}
}
2 changes: 1 addition & 1 deletion util/analyzers.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ test.cb( 'getAnalyzers - iterate over all availalbe analyzers', t => {

let analyzers = analyzersUtil.getAnalyzers( config );

t.same( analyzers.npm, 'getCredits' );
t.deepEqual( analyzers.npm, 'getCredits' );

cleanUpCb();

Expand Down
25 changes: 10 additions & 15 deletions util/credit.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,43 @@ import test from 'ava';
import creditUtil from './credit';


test.cb( 'getCredit - email is included', t => {
test( 'getCredit - email is included', t => {
let credits = [ { email : 'bob@calsow.io', url : 'http://4waisenkinder.de' } ];

let credit = creditUtil.getCredit( credits, { email : 'bob@calsow.io' } );

t.same( credit, { email : 'bob@calsow.io', url : 'http://4waisenkinder.de' } );
t.end();
t.deepEqual( credit, { email : 'bob@calsow.io', url : 'http://4waisenkinder.de' } );
} );

test.cb( 'getCredit - only name is included', t => {
test( 'getCredit - only name is included', t => {
let credits = [ { name : 'Bob Calsow', url : 'http://4waisenkinder.de' } ];

let credit = creditUtil.getCredit( credits, { name : 'Bob Calsow' } );

t.same( credit, { name : 'Bob Calsow', url : 'http://4waisenkinder.de' } );
t.end();
t.deepEqual( credit, { name : 'Bob Calsow', url : 'http://4waisenkinder.de' } );
} );

test.cb( 'getCredit - particular credit is not included', t => {
test( 'getCredit - particular credit is not included', t => {
let credits = [];

let credit = creditUtil.getCredit( credits, { name : 'Stefan Judis' } );

t.same( credit, false );
t.end();
t.deepEqual( credit, false );
} );


test.cb( 'addCreditToCredits - credit is not included yet', t => {
test( 'addCreditToCredits - credit is not included yet', t => {
let credits = [];

credits = creditUtil.addCreditToCredits( credits, { name : 'Bob Calsow' }, 'foo' );

t.same( credits, [ { name : 'Bob Calsow', packages : [ 'foo' ] } ] );
t.end();
t.deepEqual( credits, [ { name : 'Bob Calsow', packages : [ 'foo' ] } ] );
} );

test.cb( 'addCreditToCredits - credit is included', t => {
test( 'addCreditToCredits - credit is included', t => {
let credits = [ { name : 'Bob Calsow', packages : [ 'foo' ] } ];

credits = creditUtil.addCreditToCredits( credits, { name : 'Bob Calsow' }, 'bar' );

t.same( credits, [ { name : 'Bob Calsow', packages : [ 'foo', 'bar' ] } ] );
t.end();
t.deepEqual( credits, [ { name : 'Bob Calsow', packages : [ 'foo', 'bar' ] } ] );
} );
42 changes: 17 additions & 25 deletions util/package.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import test from 'ava';
import { authors, index } from 'all-stars';
import packageUtil from './package';

test.cb( 'getAuthor - author is a string', t => {
test( 'getAuthor - author is a string', t => {
// only short hand name
let packageJson1 = {
author : 'Bob Calsow'
};

let author1 = packageUtil.getAuthor( packageJson1 );

t.same(
t.deepEqual(
author1,
{ name : 'Bob Calsow', email : undefined, url : undefined }
);
Expand All @@ -22,7 +22,7 @@ test.cb( 'getAuthor - author is a string', t => {

let author2 = packageUtil.getAuthor( packageJson2 );

t.same(
t.deepEqual(
author2,
{ name : 'Bob Calsow', email : 'bob@calsow.io', url : undefined }
);
Expand All @@ -34,7 +34,7 @@ test.cb( 'getAuthor - author is a string', t => {

let author3 = packageUtil.getAuthor( packageJson3 );

t.same(
t.deepEqual(
author3,
{ name : 'Bob Calsow', email : 'bob@calsow.io', url : 'http://4waisenkinder.de' }
);
Expand All @@ -46,15 +46,13 @@ test.cb( 'getAuthor - author is a string', t => {

let author4 = packageUtil.getAuthor( packageJson4 );

t.same(
t.deepEqual(
author4,
{ name : 'Bob Calsow', email : undefined, url : 'http://4waisenkinder.de' }
);

t.end();
} );

test.cb( 'getAuthor - author is an object', t => {
test( 'getAuthor - author is an object', t => {
let packageJson = {
author : {
name : 'Bob Calsow',
Expand All @@ -65,20 +63,18 @@ test.cb( 'getAuthor - author is an object', t => {

let author = packageUtil.getAuthor( packageJson );

t.same( author, packageJson.author );
t.end();
t.deepEqual( author, packageJson.author );
} );

test.cb( 'getAuthor - author is not defined', t => {
test( 'getAuthor - author is not defined', t => {
let packageJson = {};

let author = packageUtil.getAuthor( packageJson );

t.same( author, false );
t.end();
t.deepEqual( author, false );
} );

test.cb( 'getAuthor - author in all-stars has additional properties', t => {
test( 'getAuthor - author in all-stars has additional properties', t => {
let packageJson = {
author : {
name : 'Archimedes of Syracuse',
Expand Down Expand Up @@ -109,11 +105,10 @@ test.cb( 'getAuthor - author in all-stars has additional properties', t => {
t.is( author.npm, fakeAuthorId );
t.is( author.github, fakeAuthorId );
t.is( author.twitter, fakeAuthorId );
t.end();
} );


test.cb( 'getMaintainers - maintainers is not defined', t => {
test( 'getMaintainers - maintainers is not defined', t => {
let packageJson = {
maintainers : [
'Bob Calsow <bob@calsow.io> (http://4waisenkinder.de)',
Expand All @@ -127,36 +122,33 @@ test.cb( 'getMaintainers - maintainers is not defined', t => {

let maintainers = packageUtil.getMaintainers( packageJson );

t.same(
t.deepEqual(
maintainers[ 0 ],
{ name : 'Bob Calsow', email : 'bob@calsow.io', url : 'http://4waisenkinder.de' }
);
t.same(
t.deepEqual(
maintainers[ 1 ],
{ name : 'Foo bar', email : 'foo@bar.io', url : 'http://foo.bar' }
);
t.end();
} );

test.cb( 'getMaintainers - maintainers is an invalid string', t => {
test( 'getMaintainers - maintainers is an invalid string', t => {
let packageJson = {
maintainers : 'Bob Calsow <bob@calsow.io> (http://4waisenkinder.de)'
};

let maintainers = packageUtil.getMaintainers( packageJson );

t.same(
t.deepEqual(
maintainers[ 0 ],
{ name : 'Bob Calsow', email : 'bob@calsow.io', url : 'http://4waisenkinder.de' }
);
t.end();
} );

test.cb( 'getMaintainers - maintainers is not defined', t => {
test( 'getMaintainers - maintainers is not defined', t => {
let packageJson = {};

let maintainers = packageUtil.getMaintainers( packageJson );

t.same( maintainers, false );
t.end();
t.deepEqual( maintainers, false );
} );

0 comments on commit 66e981e

Please sign in to comment.