GithubHelp home page GithubHelp logo

fearphage / phantomochajs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sh19910711/phantomochajs

0.0 2.0 0.0 372 KB

Test runner for client-side js

Home Page: https://www.npmjs.org/package/phantomochajs

CoffeeScript 93.04% HTML 6.96%

phantomochajs's Introduction

phantomochajs

Build Status

Auto generate test_runner.html for client-side tests (mocha + phantomjs)

Installation

$ npm install --save-dev phantomochajs

Usage (with gulp)

If you want to see examples, here is the link below:

Example: gulpfile.coffee

gulp = require "gulp"
phantomochajs = require "phantomochajs"

gulp.task "example/test", ->
  # specify test scripts in src
  gulp.src ["spec/spec_helper.coffee", "spec/**/*_spec.coffee", "spec/**/*_spec.js"]
    .pipe phantomochajs(
      host: "127.0.0.1"
      port: "28080"
    )

Run gulp

$ gulp example/test

Result

[21:00:00] Requiring external module coffee-script/register
[21:00:01] Using gulpfile ~/workspace/phantomochajs/gulpfile.coffee
[21:00:01] Starting 'example'...
[21:00:02] Finished 'example' after 573 ms


  this is coffeescript
    ✓ hello 

  this is javascript
    ✓ hello 


  2 passing (5ms)

Options

Key Type Default Description
host String 127.0.0.1 hostname of the webserver
port Number 28080 port of the webserver
server Boolean false keep the webserver
dependencies Array requirejs depend modules
test_dependencies Array mocha, chai, sinon depended modules on test
reporter String spec mocha reporter

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

MIT

Links

phantomochajs's People

Contributors

sh19910711 avatar

Watchers

Phred Lane avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.