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

gulp-jasmine-phantom-requirejs

v4.0.1

Published

Jasmine 2.0 suite runner with PhantomJS and requirejs

Downloads

212

Readme

gulp-jasmine-phantom-requirejs

A gulp plugin that runs Jasmine tests with PhantomJS. Both specs and tested units must be amd modules.

Dependencies

This module uses execSync which is not available in any version of Node under 0.12.x. If you have any specific concerns about upgrading versions of Node or reasons not use execSync feel free to open an issue!

Before you install gulp-jasmine-phantom-requirejs please ensure that you have PhantomJS installed on your machine. The plugin assumes that the phantomjs binary is available in the PATH and executable from the command line.

If not, ensure you at least have phantomjs as an npm dependency. The module checks in ./node_modules/phantomjs for an executable if you do not have it installed globally.

**If you do not have phantomjs installed please install following these directions.

Install

$ npm install --save-dev gulp-jasmine-phantom-requirejs

Usage

Basic usage:

var gulp = require('gulp');
var jasmine = require('gulp-jasmine-phantom-requirejs');

gulp.task('default', function () {
  return gulp.src('spec/test.js')
          .pipe(jasmine({
            vendor: [
              'node_modules/requirejs/require.js'
            ],
            abortOnFail: true,
            requireConfig': {
              baseUrl: 'src/js',
              shim: {
                'bootstrap': ['jquery'],
                'scrollup': ['jquery'],
                'node-diff-match-patch': {
                    init: function () {
                        return new this.diff_match_patch();
                    }
                },
              },
              paths: {
                'bootstrap': 'node_modules/bootstrap/dist/js/bootstrap',
                'node-diff-match-patch': 'node_modules/node-diff-match-patch/diff_match_patch'
              }
          }));
});

Options

keepRunner

Type: boolean | string Default: false

Keep the specRunner.html file after build. If given a string, it will keep the runner at the string path.

includeStackTrace

Type: boolean Default: false

Prints out a longer stack trace for errors.

abortOnFail

Type: boolean Default: false

Exits Gulp with an status of 1 that will halt any further Gulp tasks.

specHtml

Type: string Default: null

Allows you to specify the HTML runner that Jasmine uses during tests.

vendor

Type: string | array Default: null

Allows to load scripts before testing process.

runner

Type: string Default: '/lib/jasmine-runner.js'

Allows you to specify the javascript runner that jasmine uses when running tests.

A list of vendor scripts to import into the HTML runner, either as file globs (e.g. "**/*.js") or fully-qualified URLs (e.g. "http://my.cdn.com/jquery.js").

This option accepts either a single string or an array of strings (e.g. ["test/*.js", "http://my.cdn.com/underscore.js"]).

jasmineVersion

Type: string Default: '2.0'

Specifies the version of Jasmine you want to run. Possible options are in the vendor/ folder. Just specify what 2.x minor release you want.

requireConfig

Type: Object

Config for requirejs. All paths will be resolved relative to working dir and dirs specified in serverRoots.

serverRoots

Type: Array Default: []

List of additional directories with sources. Files from specRunner will be firstly searched in these paths.

justServer

Type: boolean Default: false

Runs server to be tested in browser, skipping running in PhantomJS.

port

Type: number Default: auto detected free port

TCP port for spec server

Technologies Used

  • Node
  • Gulp