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
 version: 2.1
 orbs:
 orbs:
   node: circleci/node@1.1.6
   node: circleci/node@1.1.6
+  coveralls: coveralls/coveralls@1.0.6
+
 jobs:
 jobs:
   build-and-test:
   build-and-test:
     executor:
     executor:
@@ -12,7 +14,8 @@ jobs:
             - run: npm install
             - run: npm install
             - run: npm run lint
             - run: npm run lint
             - run: npm run typecheck
             - run: npm run typecheck
-            - run: npm test
+            - run: npm run test:coverage
+      - coveralls/upload
 workflows:
 workflows:
   build-and-test:
   build-and-test:
     jobs:
     jobs:

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

@@ -1,2 +1,3 @@
+.nyc_output
+coverage
 node_modules/
 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)
 [![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)
 [![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.
 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",
   "name": "@overleaf/o-error",
   "version": "3.0.0",
   "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.",
   "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",
   "main": "index.js",
-  "files": ["index.js", "index.d.ts"],
+  "files": [
+    "index.js",
+    "index.d.ts"
+  ],
   "scripts": {
   "scripts": {
     "lint": "eslint .",
     "lint": "eslint .",
     "update-readme": "doc/update-readme.js",
     "update-readme": "doc/update-readme.js",
     "test": "mocha",
     "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",
     "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: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",
     "declaration:check": "git diff --exit-code -- index.d.ts",
@@ -34,7 +47,9 @@
     "jsdoc-to-markdown": "^5.0.3",
     "jsdoc-to-markdown": "^5.0.3",
     "markdown-toc": "^1.2.0",
     "markdown-toc": "^1.2.0",
     "mocha": "^7.1.1",
     "mocha": "^7.1.1",
+    "nyc": "^15.0.1",
     "prettier": "^2.0.2",
     "prettier": "^2.0.2",
     "typescript": "^3.8.3"
     "typescript": "^3.8.3"
-  }
+  },
+  "dependencies": {}
 }
 }

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