npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

karma-tibet

v0.2.3

Published

A Karma plugin. Adapter for TIBET test harness.

Downloads

46

Readme

karma-tibet

The karma-tibet adapter allows you to use Karma as a test runner for TIBET tests.

TIBET's testing framework supports unified testing in the browser without the need for installing Selenium or WebDriver components. Using Karma as a test runner adds the ability to run your tests cross-browser and to integrate more effectively with various CI environments such as Travis CI and Sauce Labs.

Installation

Install Karma following the instructions for your platform found at https://karma-runner.github.io/latest/intro/installation.html. For example:

# position yourself in your TIBET project
cd {{project}}

# globally install the karma-cli module (to let you run karma easily).
npm install -g karma-cli

# locally install the karma module
npm install --save-dev karma

# locally install target browser launchers (Chrome, Firefox, Safari, IE etc.)
npm install --save-dev karma-chrome-launcher
npm install --save-dev karma-firefox-launcher
npm install --save-dev karma-safari-launcher
npm install --save-dev karma-ie-launcher

Once Karma is installed use the following npm command to install karma-tibet:

# locally install the karma-tibet framework module
npm install --save-dev karma-tibet

As a post-install step the karma-tibet package will copy a prebuilt karma.conf.js file to your TIBET project directory. If you already have a karma.conf.js file it will by moved to karma.conf.js.orig to preserve any settings you have in place.

Once installation is complete you should be able to run your TIBET tests using the following command from the root of your project:

# using the 'tibet test' command:
tibet test

# with karma-cli module installed:
karma start

# without the karma-cli module installed:
./node_modules/.bin/karma start

karma.conf.js

The karma-tibet adapter includes a prebuilt karma.conf.js file which is specifically designed to integrate with TIBET projects. This integration means that for the most part you won't need to edit your karma.conf.js file but can instead make use of TIBET's configuration system to define how you want your tests to run.

Because TIBET is an emphatically single-page framework that boots once on startup it's important to rely on the default configuration for karma startup and define you test targets via normal TIBET means.

tibet config karma

TIBET's tibet config command can dump current settings for karma properties at the command line. Sample values are shown below:

$ tibet config karma

{
    "karma.boot.inlined": true,
    "karma.boot.minified": true,
    "karma.boot.profile": "main@developer",
    "karma.boot.teamtibet": false,
    "karma.load_path": "TIBET-INF/tibet/lib/src",
    "karma.load_script": "tibet_loader.min.js",
    "karma.port": 9876,
    "karma.proxy": 9877,
    "karma.script": ":test",
    "karma.slot": "__karma__",
    "karma.timeout": 60000
}

tibet.json

Using TIBET's configuration system or directly editing the public/tibet.json file allows you to modify any of the karma configuration values. For example, to run on a specific set of browsers we might use:

"karma": {
    "browsers": ["Chrome", "Firefox", "Safari", "IE"]
},

Troubleshooting

Browser Doesn't Launch

One thing that can occur if your Chrome, Firefox, or other browser installation location doesn't match the location a particular karma launch plugin expects is you'll type karma start but the browser(s) won't appear. If that happens ensure you set the appropriate environment variables using syntax for your platform and shell similar to:

# Chrome
export CHROME_BIN=/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome

# Firefox
export FIREFOX_BIN=/Applications/Firefox420.app/Contents/MacOS/firefox

Note that you'll need to use the paths specific to your machine and browser install directories, however once you get these variables set properly you should see karma start and execute your tests properly.

More Info

For more information see http://www.technicalpursuit.com and the TIBET wiki at https://github.com/TechnicalPursuit/TIBET/wiki.