# phantomochajs

> Run mocha tests in a PhantomJS (with auto generate test_runner.html)

Latest version **1.0.16** (published 2014-10-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install phantomochajs
pnpm add phantomochajs
yarn add phantomochajs
bun add phantomochajs
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.16 |
| Published | 2014-10-13 |
| First published | 2014-10-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Hiroyuki Sano |
| Maintainers | sh19910711 |

## Links

- npm: https://www.npmjs.com/package/phantomochajs
- Repository: https://github.com/sh19910711/phantomochajs
- Issues: https://github.com/sh19910711/phantomochajs/issues
- npm.io page: https://npm.io/package/phantomochajs

## Dependencies (7)

- [glob](https://npm.io/package/glob.md) ^4.0.6
- [jade](https://npm.io/package/jade.md) ^1.7.0
- [connect](https://npm.io/package/connect.md) ^3.2.0
- [through2](https://npm.io/package/through2.md) ^0.6.2
- [coffee-script](https://npm.io/package/coffee-script.md) ^1.8.0
- [connect-mincer](https://npm.io/package/connect-mincer.md) ^1.0.0
- [mocha-phantomjs](https://npm.io/package/mocha-phantomjs.md) ^3.5.0

## Recent versions

- 1.0.16 (latest) — 2014-10-13
- 1.0.15 — 2014-10-13
- 1.0.14 — 2014-10-13
- 1.0.13 — 2014-10-13
- 1.0.12 — 2014-10-13
- 1.0.10 — 2014-10-13
- 1.0.9 — 2014-10-13
- 1.0.8 — 2014-10-05
- 1.0.6 — 2014-10-05
- 1.0.5 — 2014-10-05
- 1.0.4 — 2014-10-05
- 1.0.3 — 2014-10-05
- 1.0.2 — 2014-10-05
- 1.0.0 — 2014-10-05

## README

# phantomochajs

[![Build Status](https://travis-ci.org/sh19910711/phantomochajs.svg?branch=master)](https://travis-ci.org/sh19910711/phantomochajs)

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

## Installation

```sh
$ npm install --save-dev phantomochajs
```

## Usage (with gulp)

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

* phantomochajs (mocha + phantomjs) + requirejs + backbone
  * https://github.com/sh19910711/phantomochajs-example

### Example: gulpfile.coffee

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

```sh
$ gulp example/test
```

### Result

```text
[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

* https://github.com/mrhooray/gulp-mocha-phantomjs
* https://github.com/schickling/gulp-webserver

---
_Source: https://npm.io/package/phantomochajs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
