GitXplorerGitXplorer
t

mocha-ci-driver

public
7 stars
2 forks
0 issues

Commits

List of commits on branch master.
Unverified
7949cf7fec9710683d96e0de4f5270ecbe344043

jshint

ttricknotes committed 12 years ago
Unverified
32026a254f1fc3ee8fc0c7b06d4217fb5d5428a1

Simplize scripts syntax

ttricknotes committed 12 years ago
Unverified
93c93f2704726509786284041fb15cf8032f4c5f

Bump version to 0.2.0-1

ttricknotes committed 12 years ago
Unverified
a3c0196f50aaba66e7042e654a57c8c8813434ef

Fix to support Node 0.6

ttricknotes committed 12 years ago
Unverified
aea54555a2d8a98f130d756a4b21ed918f735efe

Bump version to 0.2.0

ttricknotes committed 12 years ago
Unverified
f00af27b7e1a0ed7ea128acfa103d516a105cf08

Node 0.9 is not supported

ttricknotes committed 12 years ago

README

The README file for this repository.

mocha CI driver

Build Status

mocha-ci-driver is a driver that make test written by mocha for browser working on Node.js.

Your code and test for browser works on Node.js without rewriting for Node.js.

Install

$ npm install mocha-ci-driver

The other way:

$ cd YOUR_PROJECT_HOME
$ git clone git://github.com/tricknotes/mocha-ci-driver.git ./node_modules/mocha-ci-driver

Usage

Setup:

Modify ./test/index.html(Your test html)

<script>
  // Execute `mocha.run()` when accessed from browser
  if (!/Node.js/.test(navigator.appName)) {
    mocha.run();
  }
</script>

Add ./test/driver.js

var Driver = require('mocha-ci-driver').Driver
  , driver = new Driver()

driver.run(__dirname+'/test/index.html');

And run

$ node ./test/driver.js

Optional

Use other reporter (default is Dot):

driver.run(__dirname+'/test/index.html', {reporter: 'Spec'});

Run multiple tests:

driver.run(__dirname+'/test/index1.html');
driver.run(__dirname+'/test/index2.html');

Test

$ npm test

License

(The MIT License)

Copyright (c) 2012 Ryunosuke SATO <tricknotes.rs@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.