Coder Social home page Coder Social logo

jscover's Introduction

jscover

node wrap for JSCover.

  • jscoverage: 94%

Install

$ npm install jscover -g

Usage

Just like jscoverage

# jscoverage lib lib-cov
$ jscover lib lib-cov

Authors

$ git summary

 project  : jscover
 repo age : 4 months
 active   : 9 days
 commits  : 30
 files    : 18
 authors  :
    30  fengmk2                 100.0%

License

MIT

jscover's People

Contributors

fengmk2 avatar saper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jscover's Issues

jsCoverage not working with Squire.js dependency injection

We are injecting mocks into our code using squire.js. Code covered by such tests is not being reported as covered.

EXAMPLE:

require(['Foo'], function(foo)  {
      describe('Foo', function() {
         it('should do bar', function() {
             foo.bar();
             foo.should...
        });
    });
});

Coverage is reported for Foo.js.

BUT:

describe('Foo', function() {
   it('should do bar', function() {
      var Squire = require('squirejs');
      var sinon = require('sinon');
      var injector = new Squire();
      var bamSpy = sinon.spy();
      var mockBaz = {
            bam: bamSpy
     }
      injector.mock('baz', mockBaz)
           .require(['Foo'], function(foo) {
                foo.bar();
                sinon.assert.called(bamSpy);
      });
   });
});

No coverage is reported for Foo.js.

We are using up-front instrumentation. We are using a fork of jscoverage 0.3.7.

Security Notice & Bug Bounty - Command Injection - huntr.dev

Overview

jscover is a node wrap for JSCover.
Affected versions of this package are vulnerable to Command Injection.
The source argument can be controlled by users without any sanitization.

Bug Bounty

We have opened up a bounty for this issue on our bug bounty platform. Want to solve this vulnerability and get rewarded ๐Ÿ’ฐ? Go to https://huntr.dev/

We will submit a pull request directly to your repository with the fix as soon as possible. Want to learn more? Go to https://github.com/418sec/huntr ๐Ÿ“š

Automatically generated by @huntr-helper...

JSCoverage : Permission denied generating coverage report

I am trying to generate a coverage report. I am running jscoverage from Makefile as following

make coverage

coverage: test
    @mv ./node_modules/kuler ./node_modules/kuler.actual
    @node_modules/jscoverage --no-highlight ./node_modules/sample.actual ./node_modules/sample
    @./node_modules/.bin/mocha --timeout 30s  -R html-cov test/unit > coverage.html
    @rm -rf ./node_modules/sample
    @mv ./node_modules/sample.actual ./node_modules/sample
test: dummy
    @node_modules/mocha/bin/mocha --timeout 100s test/db
    @node_modules/mocha/bin/mocha \
    --reporter spec \
    --ui bdd \
    --timeout 30s \
    test/unit \
    test/bug_test

I am getting permission denied make: node_modules/jscoverage:
Permission denied make: *** [coverage] Error 1

Can someone please help?

Please use semver

Hello,

in the recent update from v0.2.1 to v0.2.2 of jscover, JSCover was updated from v0.1.1 to v0.2.2. This is unfortunate as it turns out that mocha is not compatible with the new version.

Now that version number of jscover and JSCover are aligned, it would be really nice if you could publish jscover with the same version number as the embedded JSCover. It would simplify things when looking for what as changed between two versions (and prevent non backward compatible changes in patch versions)

Regards

Encoding and JSCover v0.0.10

Question - Can you try v0.0.10 without the -Dfile.encoding=UTF-8? I've tried to set this as the default (it was missing on some file reading).

I've also added the --encoding option to JSCover to allow changing of the encoding, but you shouldn't need this if the default is UTF-8.

Update: I've found a problem and pulled the download. I've got a test for this now so should have fixed soon.

Updating to latest JSCover

The latest JSCover will generate Cobertura style reports (as of March 11, 2013). Do you have any plans for updating to this?

Why i used this tool making a low coverage report.

1   var dbpool = require('./db');

2 1 var daysofflog = require('./log');
3 1 dbpool.init();
4 1 daysofflog.init();
5
6 1 function Query() {
7
8 1 };
9 1 module.exports = Query;
10
11 1 Query.getHistory=function getHistory(user_id,role_id,manager_id,begdate,enddate,teammember,callback)
12 {
13 0 var handle = dbpool.getHandle();
14 0 console.log("get handle id:"+handle);
15 0 var connn=dbpool.getConn(handle);
16 0 var strsql="select daysoff_id,user_id,daysoff_start_date,daysoff_end_date,applied_date,status,full_name,applied_reason from daysoff_rec where status > 0 and ";
17 0 if (role_id == 0)
18 {
19 0 strsql+=" user_id = '"+user_id+"' ";
20 }
21 0 else if ( teammember != null )
22 {
23 0 strsql+=" full_name in ( "+teammember+" )";

See above code segment, function "Query.getHistory" is covered ,but why doesn't inside of this function be covered ?

cobertura-xml

Is it possible to generate cobertura-xml directly with mocha?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.