
Create a element with the annotations (all the any in the code), using the DetailPage component. To include Codemirror, I have to add some assets to the page (a couple of JS assets and one CSS asset so far) - remember I’m only using React for static markup generation. There’s one more problem: Since we’re creating static HTML pages, I need to import the JavaScript via the script tag and can’t rely on React for anything that isn’t markup.Īt this point, I accidentally overwrote all the source files with the generated coverage files, losing 1/3 of what I did (luckily I committed 2/3 of what I did). I originally went for the latter, but annotations weren’t straightforward to implement - so I decided to go for the former. I had a look around, and I nailed it down to two options: Codemirror and Ace.
#JEST TEAMCITY REPORTER CODE#

Now, let’s visualize it by creating the first reporter. So I’m simply going to create a getCoverage that gathers information from that and passes it down to a reporter file. Let’s start with the data: type-coverage-core (exported by the type-coverage monorepo) gives us a lint function that returns this type of object: Promise a project strongly inspired by its Flow alternative, I wanted this one to support the same features: export and render a coverage report in HTML, JSON, and text (a table on the terminal). = #textįollowing is displayed on the terminal: -| -| -| -| -| -|įile | % Stmts | % Branch | % Funcs | % Lines | Uncovered Lines | The following is generated at coverage/: TN: SF:$PROJECT_PATH /src/bar/index.tsĭA: 1, 1 DA: 2, 1 DA: 3, 1 DA: 5, 1 DA: 8, 2 DA: 9, 1 DA: 13, 1 DA: 16, 1 DA: 20, 1 DA: 21, 1 LF: 10 LH: 10 BRDA: 8, 0, 0, 1 BRDA: 8, 0, 1, 1 BRF: 2 BRH: 2įollowing is displayed on the terminal: #teamcity #teamcity #teamcity #teamcity #teamcity #teamcity #teamcity #teamcity #teamcity #teamcity #text-lcovįollowing is displayed on the terminal: TN: SF:$PROJECT_PATH /src/bar/index.tsįollowing is displayed on the terminal: = Coverage summary = Same as lcovonly, but also generates a HTML report you can view in your browser: The following is generated at coverage/coverage-summary.json: Generates a HTML report you can view in your browser: The following is generated at coverage/cobertura-coverage.xml: $PROJECT_PATH #html The following is generated at coverage/clover.xml: #cobertura Below is a list of all available reporters, as well as the output it generates. However, you may specify an alternative reporter.

By default nyc uses Istanbul's text reporter.
