Questions tagged [isparta]

Isparta is a npm package which acts as a code coverage tool for ES6 using babel.

Definition:

According to the Official Documentation:

Isparta is a code coverage tool for ES6 using babel.

Its intention is to be used with karma and karma-coverage, which provides code coverage reports using istanbul.

In other words, Isparta is a npm package which acts as a code coverage tool for ES6.

Installation:

npm install --save-dev isparta

Example Usage:

The following command would allow you to run a coverage over mocha tests:

babel-node node_modules/isparta/bin/isparta cover --report text --report html node_modules/mocha/bin/_mocha -- --reporter dot

Important Links:

Related Tags:

48 questions
3
votes
0 answers

Karma Coverage for React JSX Files is Corrupted

I'm running test coverage over my .js and .jsx files using karma, mocha, and isparta for ES6 code coverage. For some reason the coverage report over .jsx files is corrupted. See the following image: The report looks the same for all of the .jsx…
Ziv Levy
  • 1,904
  • 2
  • 21
  • 32
3
votes
0 answers

The Latest angular-fullstack-generator Is Missing the glyphicons-halflings-regular Fonts in the gulp serve:dist? Why?

I have a large project based on the angular-fullstack-generator, and when I run: gulp serve:dist I see: GET /bower_components/bootstrap-sass-official/vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.woff 404 0.739 ms - 14 GET…
JoelParke
  • 2,676
  • 2
  • 24
  • 38
3
votes
0 answers

karma-webpack-tape: Show Line Number when Test Fails

As the title implies, I want to be able to see the line number when a test fails in my suite. I'm relying on the karma-tap plugin, the tap framework, and dots reporter. A little context: source-maps are working properly, so exceptions thrown in a…
ucileamarn
  • 73
  • 6
3
votes
1 answer

How Can I Define a Test Directory for Mocha?

I've written my tests using ES6 and executed them (with code coverage report) as follows: $> babel-node isparta cover _mocha backend/tests However, the tests are not found. It only works when I have a ./test directory. Any suggestions on how I can…
Jeanluca Scaljeri
  • 26,343
  • 56
  • 205
  • 333
2
votes
1 answer

Istanbul with webpack, getting `require.context` is `undefined`

When using karma-webpack and istanbul-instrumenter-loader or isparta-loader, I get an error when attempting to implement it. require.context comes up as undefined. I believe this is because it is using/finding nodejs require and NOT webpack, as…
Kirk Strobeck
  • 17,984
  • 20
  • 75
  • 114
2
votes
1 answer

Can't Get Bootstrap v4 Working in react-slingshot

I am using react-slingshot to build my React applications, and I am trying to integrate Bootstrap v4 into it and not having any luck with getting the JavaScript working. So far, I have a package.json file that looks like the following: { "name":…
Ryan-Neal Mes
  • 6,003
  • 7
  • 52
  • 77
2
votes
0 answers

Browserify Bundle Error when Running in Karma

When I run Karma with this configuration: module.exports = function(config) { 'use strict'; config.set({ // base path that will be used to resolve all patterns (eg. files, exclude) basePath: '../../', // frameworks to use //…
Haddar Macdasi
  • 3,477
  • 8
  • 37
  • 59
2
votes
2 answers

How Can I Exclude Spec Files from Code Coverage with Karma using Webpack and Babel?

Problem I'm working on a small react-redux project configured with webpack, babel, and karma. I added code coverage to karma, but I couldn't find a way to exclude the test files from coverage. So my code coverage has spec files. How can I exclude…
André
  • 156
  • 1
  • 10
2
votes
4 answers

Gulp Node.js Istanbul Isparta

I'm trying to get unit tests coverage with Istanbul and Isparta, and I'm having some trouble. Actually, here's my gulp file tasks: gulp.task('pre-test', ['default'], function() { return gulp.src('src/app/**/*.js') .pipe(plumber()) …
Thomas thomas
  • 795
  • 2
  • 9
  • 19
1
vote
1 answer

Issue with Karma-Browserify + Karma-Coverage

I am having issues getting karma-browserify to work with karma-coverage. I have spent a lot of time trying to figure out what is wrong, but I didn't find a solution. Here is my .js file (the functions don't do anything; they are just mocks to test…
1
vote
0 answers

Cannot Find Module Imported in Test File with Karma Webpack

I received an the following error: Cannot find module "../controllers/loginCtrl" when running karma, controller file in src/controllers, test file in src/tests 1) karma.conf.js: var path = require('path'); var hasCoverage =…
Viet Dao
  • 11
  • 3
1
vote
0 answers

Module not found: Error: Cannot resolve 'file' or 'directory' -- only on Travis

I am trying to run tests with Travis CI, but I am getting: Module not found: Error: Cannot resolve 'file' or 'directory' ../api/Seminar in ... I do not see this error on my local machine (Mac). The Node version of Travis and my Mac are…
tam5
  • 3,197
  • 5
  • 24
  • 45
1
vote
1 answer

How to Unit Test an Ionic 2 Application Tutorial Karma Error: Chrome have not captured in 60000 ms, killing

I am currently learning how to unit test in Ionic 2 using Josh Monrony's tutorial. I am on Step 4: Create and Run a Unit Test. When I run npm test, Chrome opens, but it never stops loading. Then the console reports a timeout: What is causing the…
1
vote
0 answers

How to Generate EJS Template Only with Static Assets in Webpack?

I want to integrate my project with Webpack. Before we used an EJS template, and we only wanted to append the static assets such as CSS and JavaScript into the body tag. But when I use the EJS loader, the generated EJS file has other things like…
1
vote
0 answers

Karma + jspm + PhantomJS "Could not load PhantomJS"

I'm running an Aurelia project on Windows, and I want to run Karma with PhantomJS. I also have JSPM and Babel similarly in the skeleton project here. [karma]: No captured browser, open http://localhost:9876/ [karma]: Karma v0.13.22 server started at…