forked from karma-runner/karma
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docs] Rewrite readme with links to the wiki and up to date information.
- Loading branch information
1 parent
bc28ebd
commit b7a54a5
Showing
1 changed file
with
126 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,123 +1,179 @@ | ||
# Testacular [![Build Status](https://secure.travis-ci.org/vojtajina/testacular.png?branch=stable)](http://travis-ci.org/vojtajina/testacular) [![Build Status](https://secure.travis-ci.org/vojtajina/testacular.png?branch=master)](http://travis-ci.org/vojtajina/testacular) | ||
|
||
A simple tool that allows you to execute JavaScript code in multiple _real_ browsers, powered by [Node.js] and [Socket.io]. | ||
A simple tool that allows you to execute JavaScript code in multiple | ||
_real_ browsers, powered by [Node.js] and [Socket.io]. | ||
|
||
[![Build Status](https://github.com/vojtajina/testacular/raw/master/screencast_858.png)](http://www.youtube.com/watch?v=MVw8N3hTfCI) | ||
> The main purpose of Testacular is to make your TDD development easy, | ||
> fast, and fun. | ||
**The main purpose of Testacular is to make your TDD development easy, fast, and fun.** | ||
|
||
## When should I use Testacular? | ||
|
||
## Installation | ||
* You want to test code in *real* browsers. | ||
* You want to test code in multiple browsers (desktop, mobile, | ||
tablets, etc.). | ||
* You want to execute your tests locally during development. | ||
* You want to execute your tests on a continuous integration server. | ||
* You want to execute your tests on every save. | ||
* You love your terminal. | ||
* You don't want your (testing) life to suck. | ||
* You want to use [Istanbul] to automagically generate coverage | ||
reports. | ||
* You want to use [RequireJS] for your source files. | ||
|
||
First, you need to install [Node.js]. [There are installers](http://nodejs.org/download/) for both | ||
Macintosh and Windows. On Linux, we recommend using [NVM]. | ||
|
||
````bash | ||
npm install -g testacular | ||
```` | ||
## But I still want to use \_insert testing library\_ | ||
|
||
You can install Testacular even without NPM, just get the latest package and create symlinks: | ||
Testacular is not a testing framework, neither an assertion library, | ||
so for that you can use pretty much anything you like. Right now out | ||
of the box there is support for | ||
|
||
````bash | ||
# replace x.y.z with latest version | ||
curl http://registry.npmjs.org/testacular/-/testacular-x.y.z.tgz | tar -xvz && mv package testacular | ||
* [Mocha] | ||
* [Jasmine] | ||
* [QUnit] | ||
* \_anything else\_ Write your own adapter. It's not that hard. And we | ||
are here to help. | ||
|
||
|
||
## Which Browsers can I use? | ||
|
||
# create symlinks (optional) | ||
cd testacular | ||
sudo ln -s $PWD/bin/testacular /usr/local/bin/testacular | ||
```` | ||
All the major browsers are supported, if you want to know more see the | ||
[Browsers] page. | ||
|
||
## What is it good for? | ||
|
||
Mostly for testing code in multiple browsers (desktop, mobile, tablets): | ||
## I want to use it. Where do I sign? | ||
|
||
- executing tests locally during development | ||
- executing tests on a continuous integration server | ||
You don't need to sign anything but here are some resources to help | ||
you to get started. | ||
|
||
### Obligatory Screencast. | ||
|
||
## Let's do it! | ||
Every serious project has a screencast, so here is ours. Just click | ||
[here] and let the show begin. | ||
|
||
Go into your project and create a testacular configuration. Basically you need to specify the source files that you want to execute. | ||
### NPM Installation. | ||
|
||
For an example configuration, see [test/client/testacular.conf.js](https://github.com/vojtajina/testacular/blob/master/test/client/testacular.conf.js) which contains most of the options. | ||
If you have [Node.js] installed, it's as simple as | ||
|
||
````bash | ||
# create config file (testacular.conf.js by default) | ||
testacular init | ||
```bash | ||
$ npm install -g testacular | ||
``` | ||
|
||
# start server | ||
testacular start | ||
This will give you the latest stable version available on npm. If you | ||
want to live life on the edge you can do so by | ||
|
||
# open browsers you want to test (if testacular is not configured to do it for you) | ||
open http://localhost:8080 | ||
```bash | ||
$ npm install -g testacular@canary | ||
``` | ||
|
||
# if you want to run tests manually (without auto watching file changes), you can: | ||
testacular run | ||
```` | ||
The curious can have a look at the [wiki] articles for | ||
[Getting Started] and [Versioning]. | ||
|
||
## Testing frameworks support | ||
### Using it. | ||
|
||
Testacular is not a testing framework, neither an assertion library, so for that you can use pretty much anything you like. | ||
Go into your project and create a testacular configuration. That is | ||
just a simple JavaScript or CoffeeScript file that tells Testacular | ||
where all the awesomeness of your project are. | ||
|
||
However, we provide an adapter for [Jasmine], [Mocha] and [QUnit]. | ||
If you wanna write an adapter for your favourite testing framework, that's great - check out [adapter/jasmine.src.js](https://github.com/vojtajina/testacular/blob/master/adapter/jasmine.src.js) and write your own. | ||
You can find a simple example in | ||
[test/client/testacular.conf.js](https://github.com/vojtajina/testacular/blob/master/test/client/testacular.conf.js) | ||
which contains most of the options. | ||
|
||
## Browsers Supported | ||
To create your own from scratch there is the `init` command, which | ||
will be named `testacular.conf.js` by default: | ||
|
||
Please see the [wiki](https://github.com/vojtajina/testacular/wiki/Browsers) for details on supported Browsers | ||
and how to configure non-default paths. | ||
```bash | ||
$ testacular init | ||
``` | ||
This will ask you many questions and if you answered them all correct | ||
you will be allowed to use Testacular. | ||
|
||
## Why am I doing this? | ||
For more information on the configuration options see | ||
[Configuration File Overview]. | ||
|
||
Throughout the development of [AngularJS], we've been using [JSTD] for testing. I really think that JSTD is a great idea. Unfortunately, we had many problems with JSTD, so we decided to write our own test runner based on the same idea. We wanted a simple tool just for executing JavaScript tests that is both stable and fast. That's why we use the awesome [Socket.io] library and [Node.js]. | ||
Now that you have your configuration all that is left to do is to | ||
start Testacular: | ||
```bash | ||
$ testacular start | ||
``` | ||
|
||
If you want to run tests manually (without auto watching file changes), you can: | ||
```bash | ||
$ testacular run | ||
``` | ||
But only if you have started the Testacular server before. | ||
|
||
## Development | ||
|
||
If you are thinking about making Testacular better, or you just want to hack on it, that's great - [fork the repo] and become [a contributor]! | ||
## Why did you create this? | ||
|
||
````bash | ||
git clone git://github.com/vojtajina/testacular.git # or clone your fork | ||
Throughout the development of [AngularJS], we've been using [JSTD] for | ||
testing. I really think that JSTD is a great idea. Unfortunately, we | ||
had many problems with JSTD, so we decided to write our own test | ||
runner based on the same idea. We wanted a simple tool just for | ||
executing JavaScript tests that is both stable and fast. That's why we | ||
use the awesome [Socket.io] library and [Node.js]. | ||
|
||
cd testacular | ||
sudo npm install . --dev # install all dev dependencies (such as grunt, jasmine-node, etc...) | ||
```` | ||
|
||
### Tips for contributing | ||
## I still don't get it. Where can I get help? | ||
|
||
See | ||
[Contributing.md](https://github.com/vojtajina/testacular/blob/master/CONTRIBUTING.md) | ||
for more information. | ||
* [Wiki] | ||
* [Mailing List] | ||
* [Issuetracker] | ||
* [@TestacularJS] on Twitter | ||
|
||
## This is so great. I want to help. | ||
|
||
## Versions | ||
See | ||
[Contributing.md](https://github.com/vojtajina/testacular/blob/master/CONTRIBUTING.md) | ||
or the [wiki] for more information. | ||
|
||
Testacular uses [Semantic Versioning]. All even versions (eg. `0.2.x`, `0.4.x`) are considered to | ||
be stable - no breaking changes, only bug fixes. | ||
|
||
### Stable channel (branch "stable") | ||
## My boss wants a license. So where is it? | ||
|
||
npm install -g testacular | ||
### The MIT License | ||
|
||
### Canary channel (branch "master") | ||
> Copyright (C) 2011-2012 Vojta Jína. | ||
> | ||
> 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. | ||
npm install -g testacular@canary | ||
|
||
<!-- | ||
- anything on console will leak whole iframe window | ||
- it clears console before run (but works only in FF), Chrome/Safari does not allow, so do this: | ||
console.clear = clear; | ||
--> | ||
|
||
[AngularJS]: http://angularjs.org/ | ||
[JSTD]: http://code.google.com/p/js-test-driver/ | ||
[Socket.io]: http://socket.io/ | ||
[Node.js]: http://nodejs.org/ | ||
[NVM]: https://github.com/creationix/nvm | ||
[Grunt]: http://gruntjs.com/ | ||
[Jasmine]: http://pivotal.github.com/jasmine/ | ||
[Mocha]: http://visionmedia.github.com/mocha/ | ||
[QUnit]: http://qunitjs.com/ | ||
[fork the repo]: https://github.com/vojtajina/testacular/fork_select | ||
[a contributor]: https://github.com/vojtajina/testacular/graphs/contributors | ||
[Semantic Versioning]: http://semver.org/ | ||
[here]: http://www.youtube.com/watch?v=MVw8N3hTfCI | ||
[installers]: http://nodejs.org/download/ | ||
[wiki]: https://github.com/vojtajina/testacular/wiki | ||
[Wiki]: https://github.com/vojtajina/testacular/wiki | ||
[Getting Started]: https://github.com/vojtajina/testacular/wiki/Getting-Started | ||
[Versioning]: https://github.com/vojtajina/testacular/wiki/Versioning | ||
[Configuration File Overview]: https://github.com/vojtajina/testacular/wiki/Configuration-File-Overview | ||
[Mailing List]: https://groups.google.com/forum/#!forum/testacular | ||
[Issuetracker]: https://github.com/vojtajina/testacular/issues | ||
[@TestacularJS]: http://twitter.com/TestacularJS | ||
[Browsers]: https://github.com/vojtajina/testacular/wiki/Browsers | ||
[RequireJS]: http://requirejs.org/ | ||
[Istanbul]: https://github.com/gotwarlost/istanbul |