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/frontend/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
11
/* CJSX feature request here: https://github.com/benbria/coffee-coverage/issues/52 */
12
var coffeeCoverage = require("coffee-coverage");
13
var projectRoot = path.resolve(__dirname);
14
var coverageVar = coffeeCoverage.findIstanbulVariable();
15
// Only write a coverage report if we're not running inside of Istanbul.
16
var writeOnExit =
17
coverageVar == null ? projectRoot + "/coverage/coverage-coffee.json" : null;
18
19
coffeeCoverage.register({
20
instrumentor: "nyc",
21
basePath: projectRoot,
22
exclude: ["/test", "/node_modules"],
23
coverageVar: coverageVar,
24
writeOnExit: writeOnExit,
25
initAll: true,
26
});
27
28