You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.
In this comment #1 (comment) there is a link to a project that keeps the code in memory for reporting (at least I think so). That won't work with the approach I want to be able to take (several nyc commands), because memory is lost inbetween calls.
// modified to use up to date istanbul intrumenter by Frederik Petersen, fp@abusix.com, 2020"use strict";constbeautify=require("js-beautify").js_beautify;const{ createInstrumenter }=require("istanbul-lib-instrument");constinstrumenter=createInstrumenter();constfs=require("fs");constpath=require("path");const{v4: uuidv4}=require("uuid");constcodeDir="./.ajv_istanbul";module.exports=function(ajv){fs.mkdirSync(codeDir,{recursive: true});compileAddedSchemas(ajv,"_refs");compileAddedSchemas(ajv,"_schemas");ajv._opts.processCode=instrument;returnajv;};functioncompileAddedSchemas(ajv,schemasKey){for(varkeyinajv[schemasKey])ajv.getSchema(key);}functioninstrument(code){varfilePath=path.join(codeDir,"schema_gen"+uuidv4()+".js");code=beautify(code,{indent_size: 2});fs.writeFileSync(filePath,code);returninstrumenter.instrumentSync(code,filePath);}
This creates a new subfolder and puts generated code there. That allows generating html reports containing source code without needing to do instrumentation and reporting in the same step.
If someone knows a way to use CodeCov, coveralls or something similar with generated code that is not part of the repo please let me know. CodeCov doesn't even show the percentages of files that don't exist in the repo. Coveralls does at least show percentage, but no code.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When using
nyc report --reporter=lcov
ornyc report --reporter=lcov
I am gettingCannot read property 'start' of undefined
errors.It works using e.g.
--reporter=text
or--reporter=html
.Is this a bug or am I using it wrong? I don't generate the reports directly from code but want to use
nyc
to keep code more flexible.My interaction with this tool looks like this:
Edit: ah I just realized this might be using quite an old version of istanbul? I'll try to port it locally to see if that fixes it.
The text was updated successfully, but these errors were encountered: