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

gesalakacula

v1.4.0

Published

Generate SauceLabs Karma Custom Launchers --- aka --- Ge-Sa-La-Ka-Cu-La-aaaaa

Downloads

55

Readme

gesalakacula Build Status NPM version

Generate SauceLabs Karma Custom Launchers --- aka --- Ge-Sa-La-Ka-Cu-La-aaaaa

It's intention is to be used with karma and karma-sauce-launcher, which runs unit tests on the Sauce Labs browsers.

Installation

gesalakacula can be installed using

$ npm i -D gesalakacula

Usage

// In your karma.conf.js
var geSaLaKaCuLa = require('gesalakacula');

module.exports = function(config) {
  var customLaunchers = geSaLaKaCuLa({
    'Windows 7': {
      'internet explorer': '8..11'
    }
  })

  // [...]

  config.browsers = Object.keys(customLaunchers);
  config.customLaunchers = customLaunchers;
});

Config Object

gesalakacula generate launchers from a config object. This one has 3 main areas:

{
  // The platforms      (1)
  'Linux': { 
    // The browsers     (2)
    'chrome': [
      // The versions   (3)
    ]
  }
}

You're suppose to use the Sauce Labs platform(1)/browser(2)/versions(3) combos.

For the versions(3) you can use an array or a range string like : \d+..\d+.

Sample

« All The Sauce Labs Browsers Are Mine To Test ! GeSaLaKaCuLa-aaaaa ! »

geSaLaKaCuLa({
  'Linux': {
    'android': '4.0,4.1,4.2,4.3,4.4',
    'chrome': '26..39,beta,dev',
    'firefox': '3.6,4..34,beta,dev',
    'opera': '12'
  },
  'OS X 10.6': {
    'ipad': '4.3, 5.0',
    'iphone': '4.3, 5.0',
    'chrome': '27..39,beta,dev',
    'firefox': '4..34,beta,dev',
    'safari': '5'
  },
  'OS X 10.8': {
    'ipad': '5.1,6.0,6.1',
    'iphone': '5.1,6.0,6.1',
    'chrome': '27..39,beta,dev',
    'safari': '6'
  },
  'OS X 10.9': {
    'ipad': '7.0,7.1,8.0,8.1',
    'iphone': '7.0,7.1,8.0,8.1',
    'chrome': '31..39',
    'firefox': '4..34,beta,dev',
    'safari': '7'
  },
  'OS X 10.10': {
    'chrome': '37..39',
    'firefox': '32..34',
    'safari': '8'
  },
  'Windows XP': {
    'chrome': '26..39,beta,dev',
    'firefox': '3.0,3.5,3.6,4..34,beta,dev',
    'internet explorer': '6..8',
    'opera': '11..12'
  },
  'Windows 7': {
    'chrome': '26..39,beta,dev',
    'firefox': '3.0,3.5,3.6,4..34,beta,dev',
    'internet explorer': '8..11',
    'opera': '11..12'
  },
  'Windows 8': {
    'chrome': '26..39,beta,dev',
    'firefox': '3.0,3.5,3.6,4..34,beta,dev',
    'internet explorer': '10'
  },
  'Windows 8.1': {
    'chrome': '26..39,beta,dev',
    'firefox': '3.0,3.5,3.6,4..34,beta,dev',
    'internet explorer': '11'
  }
});
// Run on every platforms-browsers-versions on Sauce Labs (known 2015/1/1)

Check my dummy fuzzy batman for more

Extra: Re-Ka-La-Re-Ka-La-Re-Ka-La

Sauce Labs provide free accounts for open source project with

  • Unlimited testing minutes
  • 5 parallel tests

giphy

Karma is a bit difficult to configure with Sauce Labs. Like there is no "queue" principal, Karma try to connect to all the browsers at the same time. There for when a browser in the Sauce Labs queue will often reach the browserDisconnectTimeout and cause the test to fail without actually running them.

So I came with a simple idea of recursively restarting a karma server with the 5 parallel browsers limit of Sauce Labs.

Thus, there is not potential browserDisconnectTimeout of browser in the Sauce Labs queue...

giphy 1

Usage

var reKaLa = geSaLaKaCuLa.recursiveKarmaLauncher;

reKaLa({
  karma: require('karma').server,
  customLaunchers: geSaLaKaCuLa({'Linux': {'chrome': '20..30'}})
}, function (code){
  console.log('reKaLa end with ', code);
  process.exit(code);
});

.recursiveKarmaLauncher(opts, doneCallback)

opts : The options for reKaLa (TODO can be using as extended karma options ?)

require :

{
  karma: require('karma').server
}

default :

{
  configFile: './karma.conf.js',
  customLaunchers: {},
  maxConcurrentRun : 5
}

doneCallback: will be call at the recursion end with the incremented exit code (of each karma run).

License

Copyright © 2014 Douglas Duteil <[email protected]>
This work is free. You can redistribute it and/or modify it under the
terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See the LICENCE file for more details.