• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

dflynn15/gulp-jasmine-phantom: Gulp plugin to run Jasmine tests with Phantom or ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

dflynn15/gulp-jasmine-phantom

开源软件地址(OpenSource Url):

https://github.com/dflynn15/gulp-jasmine-phantom

开源编程语言(OpenSource Language):

JavaScript 97.3%

开源软件介绍(OpenSource Introduction):

gulp-jasmine-phantom

A gulp plugin that runs Jasmine tests with either PhantomJS or minijasminenode2.

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 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

Usage

By default, gulp-jasmine-phantom runs your tests with minijasminenode and not phantomjs. This is an effort to keep your tasks running as quickly as possible!

Basic usage:

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

gulp.task('default', function () {
  return gulp.src('spec/test.js')
          .pipe(jasmine());
});

To use phantomjs for tests (ie: integration tests) use the following setup:

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

gulp.task('default', function() {
  return gulp.src('spec/test.js')
          .pipe(jasmine({
            integration: true
          }));
});

Also, remember you can always run any multitude of tests using different Gulp tasks. For example, running unit tests and integration tests asynchronously.

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

gulp.task('unitTests', function () {
  return gulp.src('spec/test.js')
          .pipe(jasmine());
});

gulp.task('integrationTests', function() {
  return gulp.src('spec/test.js')
          .pipe(jasmine({
            integration: true
          }));
});

Options

integration

Type: boolean
Default: false

Run your tests with phantomjs

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

Currently built with integration mode only
Exits Gulp with an status of 1 that will halt any further Gulp tasks.

specHtml

Type: string
Default: null

Only use in combination with integration: true

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

vendor

Type: string | array
Default: null

runner

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

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

Only use in combination with integration: true

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 (integration tests only)

Type: string
Default: '2.0'

Only use in combination with integration: true

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.

random (unit tests only)

Type: 'boolean'
Default: false

Allows you to run the unit tests in a semi-random order. The random seed will be printed out after the tests have completed to allow for easier debugging.

reporter

Type: object
Default: './lib/terminal-reporter.js'

Allows you to specify a custom reporter (e.g. "reporter": require('jasmine-spec-reporter'))

This reporter will also pull in options from gulpOptions.

seed (unit tests only)

Type: 'number'

Provides a given seed to Jasmine to run the tests in.

Technologies Used

  • Node
  • Gulp



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap