GithubHelp home page GithubHelp logo

mishabosin / run-browser Goto Github PK

View Code? Open in Web Editor NEW

This project forked from forbeslindesay/run-browser

0.0 1.0 0.0 370 KB

The simplest way to run testling type tests in the browser

License: MIT License

JavaScript 96.85% HTML 3.15%

run-browser's Introduction

run-browser

The simplest way to run testling type tests in the browser

Dependency Status NPM version

Installation

npm install run-browser -g

Usage

run-browser <file> <options>

Options:
  -p --port <number> The port number to run the server on (default: 3000)
  -b --phantom       Use the phantom headless browser to run tests and then exit with the correct status code (if tests output TAP)
  -r --report        Generate coverage Istanbul report. Repeat for each type of coverage report desired. (default: text only)
  -t --timeout       Global timeout in milliseconds for tests to finish. (default: Infinity)

Example:
  run-browser test-file.js --port 3030 --report text --report html --report=cobertura

API Usage

Basic usage:

var runBrowser = require('run-browser');

var server = runBrowser('tests/test.js');
server.listen(3000);

Advanced Usage:

var runBrowser = require('run-browser');

var handler = runBrowser.createHandler('tests/test.js');
var server = http.createServer(function (req, res) {
  if (runBrowser.handles(req)) {
    return handler(req, res);
  }
  // any other server logic here
});
server.listen(3000);

For advanced phantomjs usage, just read the source in ./bin/cli.js

License

MIT

run-browser's People

Contributors

forbeslindesay avatar andrewdeandrade avatar raynos avatar shinnn avatar

Watchers

Misha Bosin 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.