curran / jspm-mocha-example Goto Github PK
View Code? Open in Web Editor NEWAn example project that uses Mocha and JSPM.
License: MIT License
An example project that uses Mocha and JSPM.
License: MIT License
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.
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.
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?
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.
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?
Please could you provide an example with jsdom
? I'm really struggling to make it work.
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 a Travis CI badge to the repo and set up the necessary configuration to get this ES6 testing scheme playing nicely with CI.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.