GithubHelp home page GithubHelp logo

marsmining / karma-closure Goto Github PK

View Code? Open in Web Editor NEW

This project forked from karma-runner/karma-closure

0.0 2.0 0.0 4.06 MB

A Karma plugin. Resolve Google Closure dependencies on the fly.

License: MIT License

CoffeeScript 0.08% JavaScript 66.03% HTML 33.22% CSS 0.67%

karma-closure's Introduction

karma-closure Build Status

A Karma plugin that resolves Google Closure dependencies on the fly.

Installation

The easiest way is to keep karma-closure as a devDependency in your package.json.

{
  "devDependencies": {
    "karma": "~0.10",
    "karma-closure": "~0.1"
  }
}

Configuration

// karma.conf.js
module.exports = function(config) {
  config.set({
    frameworks: ['jasmine', 'closure'],
    files: [
      // closure base
      'lib/goog/base.js',

      // included files - tests
      'test/*.js',

      // source files - these are only watched and served
      {pattern: 'js/*.js', included: false},

      // external deps
      {pattern: 'lib/goog/deps.js', included: false, served: false}
    ],

    preprocessors: {
      // tests are preprocessed for dependencies (closure) and for iits
      'test/*.js': ['closure', 'closure-iit'],
      // source files are preprocessed for dependencies
      'js/*.js': ['closure'],
      // external deps
      'lib/goog/deps.js': ['closure-deps']
    }
  });
};

For an example project, check out ./test-app/

IIT preprocessor

When using iit or ddescribe, Jasmine only executes these tests (resp. the patched version that comes with Karma). But still, all the tests (even those that are not actually executed) are shipped to the browser, parsed and the definition of the tests is executed. On a huge project, this can easily take seconds.

The iit preprocessor looks for test files that contain iit and only ships these tests (and their dependencies), which can significantly speed up running the tests during the development !


For more information on Karma see the homepage.

karma-closure's People

Contributors

boushley avatar marsmining avatar vojtajina avatar

Watchers

 avatar  avatar

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.