Questions tagged [nyc]

a command-line interface for the Istanbul code coverage tool.

nyc is a command-line interface for the Istanbul code coverage tool.

147 questions
0
votes
1 answer

NYC Istanbul, generate report with testcase name

When I generate a coverage report using nyc it always give coverage results of the file(how much percentage is been covered). Although is there any way to figure out, which testcase name has contribute to the coverage of that file ?
Mayank Raipure
  • 1,773
  • 15
  • 12
0
votes
1 answer

Nyc coverage is not working for me when using functional approach with e.g. ramda

So my code is this: const handler = (event = { body: {} }) => { if (isEventEmpty(event)) { return Promise.resolve({}) } const getPayload = R.compose( R.flatten, R.map(x => transformRecord(x)), R.pluck('Stuff'), …
mjakic
  • 373
  • 1
  • 4
  • 14
0
votes
1 answer

Convert Cobertura.xml to html report

Is it possible to convert a cobertura.xml file to an html report or similar, so it can be viewed locally? I already have it pretty-printing in Jenkins but we need it locally too... The report has been produced using istanbul/nyc, and the code it's…
rozza
  • 927
  • 2
  • 11
  • 24
0
votes
1 answer

Nyc doesn't show coverage for functions in an array

I have a list of functions that are filtered and executed after a specific event occurs in the code. All functions are scored and exported as an array like below const interceptors = [ { recipeName: 'Test1', vendor: 'aaa', os:…
caltuntas
  • 10,747
  • 7
  • 34
  • 39
0
votes
1 answer

Testing js/esm project w/ sinon, nyc and ava - test w/ spy on console fails despite console log

I have an esm project I'm trying to test with ava, nyc and sinon. I have had some success using sinon to spy on console.log and report whether or not it is being called, but on another set of files, where I feel I'm doing the same things, I can't…
James South
  • 534
  • 4
  • 15
0
votes
1 answer

Istanbul test coverage information

I am using this tool(https://github.com/istanbuljs/nyc) for checking test coverage of my code, and I get output smth like this: So, question is how can I get information just in numbers, without parsing this table? maybe nyc has api for retrieving…
Guseyn Ismayylov
  • 367
  • 5
  • 16
0
votes
1 answer

Trying to test function with mocha + nyc

I'm trying to test my function with mocha + nyc for cheching coverage. This is function to test: function TypeCompare(Obj){ Obj.forEach(function (el){ el.Age = StringToNumber(el.Age); el.Name = isValidString(el.Name); el.Surname =…
Kirill
  • 69
  • 5
0
votes
1 answer

R: How to make out of a specific column of NYC zip codes a new column with the right boroughs?

This is my first Question and I couldn't find a answer on the web.. I want to make a statistic of the absolute number of cases in the 5 boroughs of NYC. PROBLEM: I have a column in a data frame in R, which is untidy. It should contain only the…
0
votes
1 answer

Istanbul nyc to include test files

I'm currently testing my coverage with mocha and nyc and I noticed some of my assert calls weren't being called. How can I include my test files in nyc to make sure all the asserts are covered? I tried: "nyc": { "include": ["**/*.js"] }, to…
pfg
  • 2,348
  • 1
  • 16
  • 37
0
votes
2 answers

vue-loader mocha-webpack lcov report has duplicate folders in filepath

I have a project originally created using vue-cli but then converted to use mocha-webpack. I've followed the guide here to add code coverage: https://github.com/zinserjan/mocha-webpack/blob/master/docs/guides/code-coverage.md I'm trying to get code…
Tom Lightbody
  • 69
  • 1
  • 5
0
votes
1 answer

Passing options to mocha when running from npm

I am setting up nyc/mocha for my project. I want to pass --exit option to mocha when running mocha with/without nyc. Here's my packages.json: "scripts": { "start": "node ./app", "test": "./node_modules/.bin/mocha --exit", …
Sumit Jain
  • 1,484
  • 2
  • 25
  • 44
-1
votes
1 answer

How to write unit tests for angularjs project using cypress

I am new to cypress and I want to write unit tests for my existing application. Can anyone suggest how to write unit tests for angular js using cypress and code coverage? I have followed the documentation but I am not getting combined results. The…
1 2 3
9
10