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
1
vote
0 answers

Gulp Task for React.js Code Coverage using gulp-istanbul

I am using React.js for a project. I am using Mocha and chai as testing frameworks. Now, I would like to to use gulp-istanbul for the code coverage part. The server side part is working absolutely fine, but when it comes to client side, I am using…
pnsrinivasreddy
  • 203
  • 2
  • 7
1
vote
1 answer

Unit Testing Browserify Project with Karma + Jasmine

I am trying to setup unit testing for a JavaScript plugin that is based on AngularJS. The plugin is bundled with Browserify via Gulp. It depends on external libraries that are injected with wiredep and gulp-inject from the bower_components folder.…
rbnvrw
  • 347
  • 3
  • 15
1
vote
1 answer

gulp-istanbul, isparta and ES6 test coverage

I'm building a REST API in which I have many unit tests. I need now to have some information about them, like code coverage. I've read many articles dealing with Istanbul and Isparta, and their ability to run test coverage (with mocha's help) of ES6…
mfrachet
  • 8,772
  • 17
  • 55
  • 110
1
vote
0 answers

Using isparta with karma with webpacked module app

I'm trying to have test coverage on my ES2015 angular code. My webapp is generated by gulp-angular, which provides by default a task that uses webpack to bundle all my angular modules in one file using the babel transpiler to generate ES5 code. So…
Dzu
  • 35
  • 6
1
vote
0 answers

Should I change env vars to use the node script under msys git bash in Windows?

Should I change the env vars to be able to use my npm script under msys git bash in Windows? I have the following test script: console.log("Test nodejs by using msys git bash"); var fs = require('fs'); console.log('__dirname',…
vcernomschi
  • 51
  • 1
  • 5
1
vote
1 answer

Should I change env vars to use the npm script under Cygwin in Windows?

Should I change env vars to be able to use npm script under Cygwin in Windows? When attempting to use the npm script under Cygwin in Windows, I receive the following error: module.js:339 throw err; ^ Error: Cannot find module…
vcernomschi
  • 51
  • 1
  • 5
0
votes
1 answer

How Can I Fix this Error with Karma & React 16.2.0?

I have this Karma configuration (with React 16.2.0): const isArray = require('lodash/lang/isArray'); const merge = require('lodash/object/merge'); const path = require('path'); const webpack = require('webpack'); const ExtractTextPlugin =…
0
votes
1 answer

React ES6 Arrow in Map Throws Syntax Error

I have a React project that was built using the React Ui-Material Admin Template. It comes bundled with webpack and some additional features, but for some reason, it throws errors when using arrow functions while trying to map an array. I use arrow…
0
votes
1 answer

How to Stop Selenium Standalone Server from Running Mocha/Chai/WebdriverIO Tests Every Time I Save a Change?

I am currently using a testing framework with Mocha, Chai, and WebdriverIO. As it stands, the Selenium Standalone Server runs the full test suite whenever I save a change to the spec file. I want to disable this and only run the test suite when I…
223seneca
  • 1,136
  • 3
  • 19
  • 47
0
votes
1 answer

Can't Get Karma Tests to Run (using Webpack & Babel)

As the title explains, I cannot get my Karma tests to run. I am using Webpack and Babel. I get the following error: 12 06 2017 16:27:40.868:INFO [karma]: Karma v1.7.0 server started at http://0.0.0.0:9876/ 12 06 2017 16:27:40.870:INFO [launcher]:…
Martin Sonesson
  • 719
  • 1
  • 6
  • 13
0
votes
2 answers

Javascript regex to match exact folder path

I have a folder structure like this: main |__Test |__Sub |__Match |__Match1 |__Match2 I have a requirement to: Match only one folder - "Match" Match multiple folder - "Match, Match1, Match2 For a) I've…
nishantcop
  • 977
  • 1
  • 8
  • 24
0
votes
1 answer

Why is Karma not receiving a message from the browser after tests execution completes?

A test was failing with: Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test. So I added this.timeout(0) to it, then I got: Disconnected, because no message in 10000 ms. I went on to add…
givanse
  • 14,503
  • 8
  • 51
  • 75
0
votes
1 answer

Getting Error Related to Webpack When Doing Unit Test for Vue

I had started a webapp, by modifying vue-hackernews-2.0. I started to write unit tests as well for it. I am getting following webpack error while setting up unit test for my Vue web app: 23 11 2016 17:13:18.968:ERROR [preprocess]: Can not load…
Saurabh
  • 71,488
  • 40
  • 181
  • 244
0
votes
1 answer

Deploying React App with webpack and Express.js

I'm developping an application using React, and webpack as the module bundler for the client part. For the server, I'm using Express.js. For the client, I'm using webpack.config.dev.js for the configuration, and I use npm start to start a web server…
fgonzalez
  • 3,787
  • 7
  • 45
  • 79
0
votes
1 answer

How to Change gulpfile.babel.js to Add HTML Locations when Running Build?

Below is the original gulpfile that came when running the generator-angular-fullstack (basically - I removed a task from running in development). I have HTML files in 'client/components/modal/templates/' that are not getting added to the project…
ZachO
  • 68
  • 9