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 🙏

© 2026 – Pkg Stats / Ryan Hefner

jasmine-data-provider

v2.2.0

Published

simple data provider for jasmine

Downloads

50,812

Readme

jasmine - data provider

  • I am used to use data provider in PHPunit so I have been searching for some solution in jasmine
  • but I found only this (https://github.com/jphpsf/jasmine-data-provider), problem is, this is just for jasmine v1.2
  • so I updated it
  • now you can use Jasmine 2.2.0 and use data providers just like that:

Usage

var using = require('jasmine-data-provider');

describe('test subtraction with data provider - direct array', function () {
    using([{a: 5, b: 2, expected: 3}, {a: 25, b: 26, expected: -1}], function (data) {
        it('should calc with operator -', function () {
            var result = calculator.calc(data.a, data.b, '-');

            expect(result).toEqual(data.expected);
        });
    });
});

Using function as a data provider

describe('test addition with data provider - provider function', function () {
    function plusProvider() {
        return [
            {a: 2, b: 3, expected: 5},
            {a: '14', b: 15, expected: 29},
            {a: 12, b: '13', expected: 25},
            {a: '22', b: '13', expected: 35},
        ];
    }

    using(plusProvider, function (data) {
        it('should calc with operator +', function () {
            var result = calculator.calc(data.a, data.b, '+');

            expect(result).toEqual(data.expected);
        });
    });
});

Now you can use object with a description that is passed into to the callback function as the last parameter

describe('My fantastic test', function () {
    var objectDataProvider = {
        'First one is awesome!': {a: 6, b: 3, expected: 9},
        'Second test should fail': {a: 8, b: 1, expected: 10}
    };

    using(objectDataProvider, function (data, description) {
        it(description, function () {
            var result = calculator.calc(data.a, data.b, '+');

            expect(result).toEqual(data.expected);
        });
    });
});

JS Module Loaders

CommonJS (like browserify), AMD (like requirejs)

Browser compatibility

Chrome 5+, Firefox 4+, Opera 12+, Safari 5+ and Internet Explorer 9+ (oh yeah..)

Installation

npm install jasmine-data-provider

Example

https://github.com/MortalFlesh/jasmine