From 033d3fab8e6e9f11198e4aa535367e3317a830c3 Mon Sep 17 00:00:00 2001 From: Fabien JUIF Date: Mon, 27 Apr 2020 09:43:23 +0200 Subject: [PATCH] :gem: coveralls & fix badges --- .gitignore | 1 + README.md | 5 +++-- index.spec.js | 3 ++- package.json | 4 +++- yarn.lock | 23 ++++++++++++++++++++++- 5 files changed, 31 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index eb03e3e..b0a432f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules *.log +coverage \ No newline at end of file diff --git a/README.md b/README.md index 8babdfa..1b77f2a 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ # graphql-directives-middlewares -GraphQL directives as middlewares +> GraphQL directives as middlewares -[![CircleCI](https://circleci.com/gh/unirakun/graphql-directives-middlewares.svg?style=shield)](https://circleci.com/gh/unirakun/graphql-directives-middlewares) [![NPM Version](https://badge.fury.io/js/graphql-directives-middlewares.svg)](https://www.npmjs.com/package/graphql-directives-middlewares) +[![npm bundle size](https://img.shields.io/bundlephobia/minzip/graphql-directives-middlewares)](https://bundlephobia.com/result?p=graphql-directives-middlewares) +[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/unirakun/graphql-directives-middlewares/Quality)](https://github.com/unirakun/graphql-directives-middlewares/actions?query=branch%3Amaster) [![NPM Version](https://badge.fury.io/js/graphql-directives-middlewares.svg)](https://www.npmjs.com/package/graphql-directives-middlewares) [![Coveralls github](https://img.shields.io/coveralls/github/unirakun/graphql-directives-middlewares.svg)](https://coveralls.io/github/unirakun/graphql-directives-middlewares) ## install diff --git a/index.spec.js b/index.spec.js index e8336c6..bf4b82a 100644 --- a/index.spec.js +++ b/index.spec.js @@ -1,3 +1,4 @@ +/* eslint-env jest */ import gql from 'graphql-tag' import { makeExecutableSchema } from 'graphql-tools' import { graphql } from 'graphql' @@ -510,7 +511,7 @@ describe('graphql-directives-middlewares', () => { const called = [] // - first const impl = jest.fn(() => ['fake']) - const middleware = jest.fn((params, next) => (...args) => { + const middleware = jest.fn(() => (...args) => { called.push('first') return impl(...args) }) diff --git a/package.json b/package.json index 8d9a958..e18d8e1 100644 --- a/package.json +++ b/package.json @@ -15,13 +15,15 @@ "test": "jest", "lint": "eslint src", "build": "babel src --source-type module --out-dir dist", - "ci": "run-p lint test build" + "coverage": "jest --coverage && cat ./coverage/lcov.info | yarn coveralls", + "ci": "run-p lint coverage build" }, "devDependencies": { "@babel/cli": "7.8.4", "@babel/core": "7.9.0", "@babel/preset-env": "7.9.5", "babel-jest": "^25.4.0", + "coveralls": "^3.1.0", "eslint": "6.8.0", "eslint-config-airbnb-base": "14.1.0", "eslint-plugin-import": "2.20.2", diff --git a/yarn.lock b/yarn.lock index 16636be..c313f4f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1705,6 +1705,17 @@ core-util-is@1.0.2, core-util-is@~1.0.0: resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= +coveralls@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-3.1.0.tgz#13c754d5e7a2dd8b44fe5269e21ca394fb4d615b" + integrity sha512-sHxOu2ELzW8/NC1UP5XVLbZDzO4S3VxfFye3XYCznopHy02YjNkHcj5bKaVw2O7hVaBdBjEdQGpie4II1mWhuQ== + dependencies: + js-yaml "^3.13.1" + lcov-parse "^1.0.0" + log-driver "^1.2.7" + minimist "^1.2.5" + request "^2.88.2" + cross-spawn@^6.0.0, cross-spawn@^6.0.5: version "6.0.5" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" @@ -3460,6 +3471,11 @@ kleur@^3.0.3: resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== +lcov-parse@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-1.0.0.tgz#eb0d46b54111ebc561acb4c408ef9363bdc8f7e0" + integrity sha1-6w1GtUER68VhrLTECO+TY73I9+A= + leven@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" @@ -3530,6 +3546,11 @@ lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== +log-driver@^1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.7.tgz#63b95021f0702fedfa2c9bb0a24e7797d71871d8" + integrity sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg== + lolex@^5.0.0: version "5.1.2" resolved "https://registry.yarnpkg.com/lolex/-/lolex-5.1.2.tgz#953694d098ce7c07bc5ed6d0e42bc6c0c6d5a367" @@ -4355,7 +4376,7 @@ request-promise-native@^1.0.7: stealthy-require "^1.1.1" tough-cookie "^2.3.3" -request@^2.88.0: +request@^2.88.0, request@^2.88.2: version "2.88.2" resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==