Skip to content

Commit

Permalink
chore: fix coverage setup
Browse files Browse the repository at this point in the history
  • Loading branch information
larsgw committed Aug 29, 2019
1 parent d49d556 commit 15ba6dc
Show file tree
Hide file tree
Showing 13 changed files with 108 additions and 18 deletions.
7 changes: 7 additions & 0 deletions .nycrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"require": [
"@babel/register"
],
"sourceMap": false,
"instrument": false
}
63 changes: 63 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 2 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"@babel/preset-env": "^7.4.5",
"@babel/register": "^7.4.4",
"babel-eslint": "^10.0.1",
"babel-plugin-istanbul": "^5.2.0",
"conventional-changelog-cli": "^2.0.21",
"expect.js": "^0.3.1",
"isomorphic-fetch": "^2.2.1",
Expand All @@ -26,20 +27,13 @@
"test:live": "npm run lerna -- TEST_MOCK_HTTP=false npm test -- -r @babel/register",
"update:test": "node scripts/tests.wikidata.js && node scripts/tests.doi.js",
"coverage": "npm run coverage:test && npm run coverage:report",
"coverage:test": "npm run lerna -- nyc --require @babel/register npm test",
"coverage:test": "npm run lerna -- nyc npm test",
"coverage:report": "npm run lerna -- nyc report --reporter=text-lcov \">\" coverage.lcov",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md",
"preversion": "npm run lint && npm test",
"version": "npm run changelog",
"postversion": "npm run babel && npm run babel-mjs"
},
"nyc": {
"require": [
"@babel/register"
],
"sourceMap": false,
"instrument": false
},
"standard": {
"parser": "babel-eslint"
}
Expand Down
3 changes: 3 additions & 0 deletions packages/cli/.nycrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../.nycrc.json"
}
3 changes: 3 additions & 0 deletions packages/core/.nycrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../.nycrc.json"
}
10 changes: 4 additions & 6 deletions packages/core/src/Cite/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { clean as parseCsl } from '../plugins/input/csl'
*
* @return {Array<String>} List of IDs
*/
const getIds = function () {
export function getIds () {
return this.data.map(entry => entry.id)
}

Expand All @@ -23,11 +23,10 @@ const getIds = function () {
*
* @return {String|Array<Object>} formatted data
*/
const format = function (format, ...options) {
export function format (format, ...options) {
return formatData(format, parseCsl(this.data), ...options)
}

/* istanbul ignore next: deprecated */
/**
* Get formatted data from your object.
*
Expand All @@ -39,7 +38,8 @@ const format = function (format, ...options) {
*
* @return {String|Array<Object>} The formatted data
*/
const get = function (options = {}) {
/* istanbul ignore next: deprecated */
export function get (options = {}) {
validate(options)

const parsedOptions = Object.assign({}, this.defaultOptions, this._options.output, options)
Expand Down Expand Up @@ -82,5 +82,3 @@ const get = function (options = {}) {
return result
}
}

export { format, getIds, get }
12 changes: 8 additions & 4 deletions packages/core/src/plugin-common/input/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,20 @@ export const formats = {
parse: jquery.parse,
parseType: {
dataType: 'ComplexObject',
// istanbul ignore next: not testable in Node
predicate: input => typeof jQuery !== 'undefined' && input instanceof jQuery
/* istanbul ignore next: not testable in Node */
predicate (input) {
return typeof jQuery !== 'undefined' && input instanceof jQuery
}
}
},
'@else/html': {
parse: html.parse,
parseType: {
dataType: 'ComplexObject',
// istanbul ignore next: not testable in Node
predicate: input => typeof HTMLElement !== 'undefined' && input instanceof HTMLElement
/* istanbul ignore next: not testable in Node */
predicate (input) {
return typeof HTMLElement !== 'undefined' && input instanceof HTMLElement
}
}
}
}
3 changes: 3 additions & 0 deletions packages/plugin-bibjson/.nycrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../.nycrc.json"
}
3 changes: 3 additions & 0 deletions packages/plugin-bibtex/.nycrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../.nycrc.json"
}
3 changes: 3 additions & 0 deletions packages/plugin-csl/.nycrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../.nycrc.json"
}
3 changes: 3 additions & 0 deletions packages/plugin-doi/.nycrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../.nycrc.json"
}
3 changes: 3 additions & 0 deletions packages/plugin-ris/.nycrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../.nycrc.json"
}
3 changes: 3 additions & 0 deletions packages/plugin-wikidata/.nycrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../.nycrc.json"
}

0 comments on commit 15ba6dc

Please sign in to comment.