From d2a479c8625cd20e00ae778f4820f3c82d0d1a73 Mon Sep 17 00:00:00 2001 From: Martijn van de Rijdt Date: Fri, 31 Jul 2020 10:49:16 -0600 Subject: [PATCH] removed: temporarily removed broken code coverage measurement, https://github.com/enketo/enketo-validate/issues/78 --- README.md | 1 - nyc.config.js | 11 --------- package.json | 3 +-- update-readme-with-shield-badge.js | 37 ------------------------------ 4 files changed, 1 insertion(+), 51 deletions(-) delete mode 100644 nyc.config.js delete mode 100644 update-readme-with-shield-badge.js diff --git a/README.md b/README.md index 6df3a26..dddd6dd 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ -![coverage-shield-badge-1](https://img.shields.io/badge/coverage-96.97%25-brightgreen.svg) [![npm version](https://badge.fury.io/js/enketo-validate.svg)](http://badge.fury.io/js/enketo-validate) [![Build Status](https://travis-ci.org/enketo/enketo-validate.svg?branch=master)](https://travis-ci.org/enketo/enketo-validate) [![Dependency Status](https://david-dm.org/enketo/enketo-validate/status.svg)](https://david-dm.org/enketo/enketo-validate) [![devDependency Status](https://david-dm.org/enketo/enketo-validate/dev-status.svg)](https://david-dm.org/enketo/enketo-validate?type=dev) Enketo Validate diff --git a/nyc.config.js b/nyc.config.js deleted file mode 100644 index 1a4392a..0000000 --- a/nyc.config.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -module.exports = { - include: [ 'src/*.js' ], - reporter: [ - 'html', - 'text-summary', - 'json' - ], - 'report-dir': './test-coverage' -}; diff --git a/package.json b/package.json index 4731698..600d494 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "src/validator.js", "bin": "./validate", "scripts": { - "test": "nyc mocha test/spec/*.spec.js --exit --timeout 5000 && npm run style-check && node update-readme-with-shield-badge.js", + "test": "mocha test/spec/*.spec.js --exit --timeout 5000 && npm run style-check", "build-docs": "rimraf docs && ./node_modules/.bin/jsdoc -c jsdoc.config.js", "prepublish": "rollup --config && rollup --config rollup.utils.config.js", "style-fix": "eslint *.js src/**/*.js test/**/*.js --fix", @@ -44,7 +44,6 @@ "istanbul-reporter-shield-badge": "^1.2.1", "jsdoc": "^3.6.5", "mocha": "^7.2.0", - "nyc": "^15.1.0", "pkg": "^4.4.9", "rimraf": "^3.0.2", "rollup": "^2.23.0", diff --git a/update-readme-with-shield-badge.js b/update-readme-with-shield-badge.js deleted file mode 100644 index 14f04c5..0000000 --- a/update-readme-with-shield-badge.js +++ /dev/null @@ -1,37 +0,0 @@ -/* global __dirname, process */ -/* eslint no-console: 0 */ -/* ************** -The only purpose of this script is to be used by the npm test script to write the shield badge within the README.md file -************** */ - -var fs = require( 'fs' ); -var path = require( 'path' ); -var istanbul = require( 'istanbul' ); -var collector = new istanbul.Collector(); -var Report = istanbul.Report; -var shieldBadgeReporter = require( 'istanbul-reporter-shield-badge' ); - -istanbul.Report.register( shieldBadgeReporter ); - -var report = Report.create( 'shield-badge', { - readmeFilename: 'README.md', - readmeDir: path.resolve( __dirname, '.' ), - subject: 'coverage' -} ); - -try { - console.log( '\n====================== Adding the badge to the ' + report.readmeFilename + ' =======================' ); - var coverageDir = path.resolve( __dirname, 'test-coverage' ); - fs.readdirSync( coverageDir ).forEach( function( file ) { - if ( file.indexOf( 'cov' ) === 0 && file.indexOf( '.json' ) > 0 ) { - collector.add( JSON.parse( fs.readFileSync( path.resolve( coverageDir, file ), 'utf8' ) ) ); - } - } ); - report.on( 'done', function() { - console.log( 'The istanbul shield badge report has been generated' ); - } ); - report.writeReport( collector, true ); -} catch ( err ) { - console.error( err.message ); - process.exit( 1 ); -}