karma-es6-shim-example

Example repository to demonstrate the usage of https://github.com/radify/karma-es6-shim

Usage no npm install needed!

<script type="module">
  import karmaEs6ShimExample from 'https://cdn.skypack.dev/karma-es6-shim-example';
</script>

README

Travis Build Status npm version Dependency Status

karma-es6-shim-example

This is simply to show how to use https://github.com/radify/karma-es6-shim to get Karma unit tests working with ES6 code, PhantomJS and Require.

Installation

npm install

Running the tests

gulp

What's what?

  • Gulpfile.js - automation script using the Gulp streaming build system. This compiles the code to ES5 and also runs the tests.
  • src/Example.js - a basic object that we can test
  • src/ExampleController.js - an AngularJS controller that we can test
  • spec/karma.conf.js - configuration for the Karma test runner
  • spec/test-main.js - configuration for Require so that the import statements work correctly
  • spec/ExampleSpec.js - a Jasmine spec that tests src/Example.js, which Karma runs
  • spec/ExampleControllerSpec.js - a Jasmine spec that tests the AngularJS code in src/ExampleController.js, which Karma runs using PhantomJS