You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

karma-extjs

Package Overview
Dependencies
Maintainers
3
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

karma-extjs

Use Karma to run tests for Ext JS applications

1.0.17
latest
Source
npmnpm
Version published
Weekly downloads
103
-32.68%
Maintainers
3
Weekly downloads
 
Created
Source

karma-extjs

Use Karma to run tests for Ext JS applications. Run tests and measure coverage without any html-file facilitation.

NPM Version Build Status Dependency Status

Install

$ npm install --save-dev karma-extjs

Usage

var karma = require('karma-extjs');

karma.run({
    coverage: true,
    staticPort: 9877,
    jsb3: 'APP/build/packages.jsb3',
    beforeSource: [
        'extjs/ext-all.js',         
        'appconfig.js'
    ],
    afterSource: [
        'testapp.js'
    ],
    tests: [
        'APP/specs/**/*.spec.js'
    ]        
});

The appconfig.js is typically a file that sets the Ext JS config. Something like:

Ext.Loader.setConfig({
    enabled: true,    
    paths: {
        'APP': 'http://' + window.location.host + '/base/APP/src',
        'APPTests': 'http://' + window.location.host + '/base/APP/specs'
    },
    disableCaching: true
});

The testapp.js is typically a file that starts the Ext JS application. Somethig like:

Ext.Loader.loadScript({
    url: '/base/APP/src/init.js',
    onLoad: function () {
        Ext.application({
            inhibitLaunch: true
        });
    }
});

API

run(options)

options

jsb3

Type: string

Path to the jsb3 file of your application/package. This is used to append source files to Karma config in the correct order.

coverage

Type: Boolean
Default: false

Enable coverage. true will add 'coverage' preprocessors to source files and add the coverage reporter.

staticPort

Type: Number
Default 9877

Serve the root of the project. Karma will use this server as a proxy when files are layzy loaded.

beforeSource

Type: Array of strings

File(s) to append to Karma files before the source files are appended.

afterSource

Type: Array of strings

File(s) to append to Karma files after the source files are appended.

karma

Type: Object

Dictionary with Karma config.

Defaults:

  • port: 9876
  • singleRun: true
  • reporters: progress
  • browsers: Chrome
  • frameworks: jasmine

Note: proxies option is overridden and cannot be configured through the API.

License

MIT © Unit4

Keywords

karma

FAQs

Package last updated on 23 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts