Giter Club home page Giter Club logo

jspm-mocha-example's Issues

Broken with jspm 0.17

Upgrading this project to [email protected] results in the following error:

ReferenceError: SystemJS is not defined

The jspm install migrator rewrites the config.js as jspm.config.js which references SystemJS. Running jspm dl-loader --latest does not help. Changing the config SystemJS to System gets past this error, but reveals the next error:

Error: Unable to fetch "npm:[email protected]". Only file URLs of the form file:/// allowed running in Node.

Despite replacing babel with plugin-babel per the [email protected] migration guide and loading mocha in SystemJS per jspm/jspm-cli#1878, the tests don't load because describe is not accessible as a global or mocha variable. This is apparently by design in mocha.

The conclusion is that there is a fundamental architectural clash between [email protected] and mocha. Until the two are reconciled, I suggest that this useful example project come with a caveat that it only works with [email protected] and below.

About coverage and testing browser code.

Hi,
I'm fairly new to Javascript and webdev world in general. Also, not a native English speaker :).

Thanks to this project i was able to get the imports on my modules working and write my tests with ES2015 but now almost all my modules have browser specific code and I'm unable to run the tests successfully on the terminal( getting errors like Image is not defined when trying to do something like let foo = new Image()) .

On this point I've tried with Phantom.js, Slimer.js, and Zombie.js and their respective plug-ins for Mocha. Except Zombie, the rest complains about the ES2015 Syntax and Zombie was unable of connect to my server.

I'm also having troubles with the code coverage. I managed to get Istanbul and Isparta throw no errors but reporting 100% coverage and showing as tested only the config.js file.

I'd appreciate to hear any advice, work flow tips or pointers that you could have (if any) to correctly test front-end code and get code coverage working with the specific combinations of tools listed on this project's README.

Thanks in advance.

Duplicate devDependencies?

Why do you duplicate your dependencies for npm in your package.json? I tried getting this to work on my end just using jspm, but Mocha running globally or from my jspm_packages folder couldn't find commander and "babel/register".

Once you I copied the devDependencies like you did in my package.json, and ran npm install, everything worked. How come I can't just use jspm?

jspm_packages

Hi

Does myModule.js actually use lodash from jspm_packages, or is it loaded from node_modules?
Another library depend on lodash, so it happens to be in node_modules.

run tests from command line?

From your index.html I assume you had trouble making it run from the command line, right? Is this impossible? What is missing to make that work so that running mocha would be enough?

Example with jsdom

Please could you provide an example with jsdom? I'm really struggling to make it work.

External Library (like Angular)

Could you provide an example of how to import a framework like Angular 1.x here? How would I load this inside the test file?

Add Travis

Add a Travis CI badge to the repo and set up the necessary configuration to get this ES6 testing scheme playing nicely with CI.

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.