Skip to content

Commit

Permalink
Added coveralls report + configs cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitaly Puzrin committed May 27, 2016
1 parent 34106c6 commit 9b77c57
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 60 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_js:
- '4'
- '6'
sudo: false
after_success: npm run report-coveralls
50 changes: 0 additions & 50 deletions Makefile

This file was deleted.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ embedza

[![Build Status](https://img.shields.io/travis/nodeca/embedza/master.svg?style=flat)](https://travis-ci.org/nodeca/embedza)
[![NPM version](https://img.shields.io/npm/v/embedza.svg?style=flat)](https://www.npmjs.org/package/embedza)
[![Coverage Status](https://coveralls.io/repos/github/nodeca/embedza/badge.svg?branch=master)](https://coveralls.io/github/nodeca/embedza?branch=master)

> Create HTML snippets/embeds from URLs using info from oEmbed,
> Open Graph, meta tags.
Expand Down
8 changes: 4 additions & 4 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ const debug = require('debug')('embedza:common');

// Load custom domains
let domains = _.reduce(requireAll(path.join(__dirname, 'domains')), (acc, config, id) => {
// If config in folder - extract
if (config.index) {
config = config.index;
}
// If config is in folder - load it. Now we have no custom domains with folders
/* istanbul ignore next */
if (config.index) config = config.index;

// Fill `id` by file name
config.id = id;
Expand Down Expand Up @@ -171,6 +170,7 @@ Embedza.prototype.render = function (url, type, callback) {
}

if (!callback) {
/* istanbul ignore next */ // Already memoised at `.info` call in tests
P = P || require('any-promise');

return new P((resolve, reject) => {
Expand Down
8 changes: 3 additions & 5 deletions lib/templates/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@ fs.readdirSync(path.join(__dirname, '..', 'domains')).forEach(function (dirName)
let dirPath = path.join(__dirname, '..', 'domains', dirName);
let stat = fs.statSync(dirPath);

if (!stat.isDirectory()) {
return; // continue
}

loadTemplates(dirPath, dirName);
// Now we have no domains with custom templates
/* istanbul ignore next */
if (stat.isDirectory()) loadTemplates(dirPath, dirName);
});


Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"require-all": "^2.0.0"
},
"devDependencies": {
"coveralls": "^2.11.9",
"eslint": "~2.10.2",
"express": "^4.13.1",
"istanbul": "^0.4.1",
Expand All @@ -37,7 +38,10 @@
"nock": "^8.0.0"
},
"scripts": {
"test": "make test",
"lint": "./node_modules/.bin/eslint .",
"test": "npm run lint && ./node_modules/.bin/mocha",
"coverage": "rm -rf coverage && ./node_modules/.bin/istanbul cover node_modules/.bin/_mocha",
"report-coveralls": "./node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage",
"install": "node support/install",
"start": "node support/server"
}
Expand Down

0 comments on commit 9b77c57

Please sign in to comment.