Git Product home page Git Product logo

Comments (4)

dtschust avatar dtschust commented on June 18, 2024

Does this work on Windows?
"test:cov": "babel-node ./node_modules/.bin/isparta cover _mocha -- --recursive --require test/setup.js"
I didn't update any versions or anything, so you might want to rm -rf node_modules && npm install before trying. I don't have a windows machine to test on so if this works for you I'll merge it in. My result was

  Redux Bug Reporter component tests
    Server side render tests
      ✓ Server side render
    Client side render tests
      ✓ Happy path (266ms)
      ✓ customEncode and customDecode properties (232ms)
      ✓ Custom submit function (215ms)
      ✓ Error listeners
      ✓ window.onerror listeners when window.onerror already exists

  Store Enhancer tests
Overriding the store. You should only be doing this if you are using the bug reporter
    ✓ bug playback functionality
    ✓ middleware functionality


  8 passing (2s)

================================================================================
Writing coverage object [/Users/drew/wrk/redux-bug-reporter/coverage/coverage.json]
Writing coverage reports at [/Users/drew/wrk/redux-bug-reporter/coverage]
================================================================================

=============================== Coverage summary ===============================
Statements   : 85.5% ( 230/269 ), 13 ignored
Branches     : 80.6% ( 108/134 ), 9 ignored
Functions    : 87.5% ( 42/48 ), 2 ignored
Lines        : 82.54% ( 156/189 )
================================================================================

Thanks!

from redux-bug-reporter.

dtschust avatar dtschust commented on June 18, 2024

I'm going to merge in my change assuming it solves your issue, if you're still having problems please feel free to reopen this issue. Thanks!

from redux-bug-reporter.

larsw avatar larsw commented on June 18, 2024

Tried again;

> npm run test:cov

> [email protected] test:cov C:\code\redux-bug-reporter
> babel-node ./node_modules/.bin/isparta cover _mocha -- --recursive --require test/setup.js

C:\code\redux-bug-reporter\node_modules\.bin\isparta:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
          ^^^^^^^
SyntaxError: missing ) after argument list
    at Object.exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:513:28)
    at Module._extensions..js (module.js:550:10)
    at Object.require.extensions.(anonymous function) [as .js] (C:\code\redux-bug-reporter\node_modules\babel-register\lib\node.js:154:7)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Function.Module.runMain (module.js:575:10)
    at C:\code\redux-bug-reporter\node_modules\babel-cli\lib\_babel-node.js:151:24
    at Object.<anonymous> (C:\code\redux-bug-reporter\node_modules\babel-cli\lib\_babel-node.js:152:7)

Seems that it picks up the sh script and not the .cmd version of isparta.

After some research, it seems that isparta isn't very Windows friendly, and that the maintainers have left it to rot. Can I recommend that you switch to nyc (an alternative istanbul frontend) instead? It works great on both Windows and unix/linux systems, ex.

nyc --reporter=text npm test

I can create an PR if you'd like.

from redux-bug-reporter.

dtschust avatar dtschust commented on June 18, 2024

@larsw That'd be great if you want to make a PR. Getting code coverage working originally was pretty hairy for me and refactoring it isn't a top priority, since it's not crucial for the developer to have it work. But if you can get it working with nyc and verify it in windows I'd love to see it!

from redux-bug-reporter.

Related Issues (14)

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.