novemberborn / copenhagen Goto Github PK
View Code? Open in Web Editor NEWExperimental infrastructure for creating Istanbul-compatible code coverage
License: ISC License
Experimental infrastructure for creating Istanbul-compatible code coverage
License: ISC License
Interesting approach to the problem. I think it has promise. Just a couple thoughts:
As a Babel plugin, I do not think this is a likely solution for CoffeeScript or TypeScript. They use their own parsers and AST. Unless they decide to throw out their current parser solutions and move to Babel, I just think it's really unlikely. There is talk of making the Babel parser extendable, but it's a low-priority, far in the future thing (Other languages moving onboard is probably even further out). I don't necessarily see this as a big problem. If copenhagen
proves to be a more reliable solution than istanbul
, then it can serve as a model for other languages - and prove that "cover before transpilation" is a good strategy.
A bigger concern is what this is going to do to power-assert
. If power-assert is applied second, I fear it will completely muddle the output. There may be other transforms to be concerned about, but I'm not sure.
I just saw a PR on Babel that fixed some source-map stuff. I wonder if that fixes any of our issues.
I doubt you are going to escape the need for exit handlers. From the docs:
Tools like nyc can use this module to get a stream for the collected data. This data can then be piped to disk, alleviating the need for exit handlers
Much of the work that went into signal-exit
was to address the issue of coverage data not making it to disk before the process exits.
var stream = fs.createWriteStream('/some/path');
// this isn't guaranteed to make it to disk if you force exit the process.
stream.write(largeChunkOfData);
process.exit();
As I said, I think there's promise. You are certainly trying to tackle a real problem, istanbul has struggled to get transpiled code right for a long time, so I think a replacement is worth pursuing. I think this approach might work. I just wanted to give you some food for thought.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.