Browse Source

Add coverage

John Lees-Miller 6 years ago
parent
commit
6cc03cad0c

+ 4 - 1
libraries/o-error/.circleci/config.yml

@@ -1,6 +1,8 @@
 version: 2.1
 orbs:
   node: circleci/node@1.1.6
+  coveralls: coveralls/coveralls@1.0.6
+
 jobs:
   build-and-test:
     executor:
@@ -12,7 +14,8 @@ jobs:
             - run: npm install
             - run: npm run lint
             - run: npm run typecheck
-            - run: npm test
+            - run: npm run test:coverage
+      - coveralls/upload
 workflows:
   build-and-test:
     jobs:

+ 2 - 1
libraries/o-error/.gitignore

@@ -1,2 +1,3 @@
+.nyc_output
+coverage
 node_modules/
-

+ 1 - 0
libraries/o-error/README.md

@@ -2,6 +2,7 @@
 
 [![npm version](https://badge.fury.io/js/%40overleaf%2Fo-error.svg)](https://badge.fury.io/js/%40overleaf%2Fo-error)
 [![CircleCI](https://circleci.com/gh/overleaf/o-error.svg?style=svg)](https://circleci.com/gh/overleaf/o-error)
+[![Coverage Status](https://coveralls.io/repos/github/overleaf/o-error/badge.svg?branch=master)](https://coveralls.io/github/overleaf/o-error?branch=master)
 
 Light-weight helpers for handling JavaScript Errors in node.js and the browser.
 

File diff suppressed because it is too large
+ 951 - 6
libraries/o-error/package-lock.json


+ 18 - 3
libraries/o-error/package.json

@@ -2,13 +2,26 @@
   "name": "@overleaf/o-error",
   "version": "3.0.0",
   "description": "Light-weight helpers for handling JavaScript Errors in node.js and the browser. Helps with long stack traces, Error subclasses, wrapping internal errors (causes), and attaching extra data to errors for logging.",
-  "keywords": ["browser", "node", "error", "long stack trace", "stack trace", "stack", "cause", "verror"],
+  "keywords": [
+    "browser",
+    "node",
+    "error",
+    "long stack trace",
+    "stack trace",
+    "stack",
+    "cause",
+    "verror"
+  ],
   "main": "index.js",
-  "files": ["index.js", "index.d.ts"],
+  "files": [
+    "index.js",
+    "index.d.ts"
+  ],
   "scripts": {
     "lint": "eslint .",
     "update-readme": "doc/update-readme.js",
     "test": "mocha",
+    "test:coverage": "nyc --reporter=lcov --reporter=text-summary npm run test",
     "typecheck": "tsc --allowJs --checkJs --noEmit --moduleResolution node --target ES6 *.js test/**/*.js",
     "declaration:build": "rm -f index.d.ts && tsc --allowJs --declaration --emitDeclarationOnly --moduleResolution node --target ES6 index.js",
     "declaration:check": "git diff --exit-code -- index.d.ts",
@@ -34,7 +47,9 @@
     "jsdoc-to-markdown": "^5.0.3",
     "markdown-toc": "^1.2.0",
     "mocha": "^7.1.1",
+    "nyc": "^15.0.1",
     "prettier": "^2.0.2",
     "typescript": "^3.8.3"
-  }
+  },
+  "dependencies": {}
 }

Some files were not shown because too many files changed in this diff