CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/util/coffee-coverage-loader.js
Views: 687
1
/*
2
* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
// run via mocha by adding '--require ./coffee-coverage-loader.js'
7
// https://github.com/benbria/coffee-coverage/blob/master/docs/HOWTO-istanbul.md
8
9
var path = require("path");
10
var coffeeCoverage = require("coffee-coverage");
11
var projectRoot = path.resolve(__dirname);
12
var coverageVar = coffeeCoverage.findIstanbulVariable();
13
// Only write a coverage report if we're not running inside of Istanbul.
14
var writeOnExit =
15
coverageVar == null ? projectRoot + "/coverage/coverage-coffee.json" : null;
16
17
coffeeCoverage.register({
18
instrumentor: "nyc",
19
basePath: projectRoot,
20
exclude: ["/test", "/node_modules"],
21
coverageVar: coverageVar,
22
writeOnExit: writeOnExit,
23
initAll: true,
24
});
25
26