node package manager
Don’t reinvent the wheel. Reuse code within your team. Create a free org »



Build Status

Yeti is a command-line tool for launching JavaScript unit tests in a browser and reporting the results without leaving your terminal. Yeti is designed to work with tests built on YUI Test just as they are.

Install Yeti

The latest release can be installed easily:

npm install -g yeti

Yeti requires Node.js, which provides the npm command for installation. You can download Node.js source or pre-built installers from their website.

Using Yeti

Running a test

Just run Yeti with the HTML files containing your tests.

$ yeti test/*.html
Creating a Hub at http://localhost:9000
Waiting for agents to connect at http://localhost:9000.
When ready, press Enter to begin testing.

Point your browsers at that URL, then come back and press Enter.

[Open some browsers...]

  Agent connected: Safari (6.0) / Mac OS
  Agent connected: Chrome (22.0.1221.0) / Mac OS

[Come back, press Enter]

✔ Testing started on Safari (6.0) / Mac OS, Chrome (22.0.1221.0) / Mac OS
Testing... / 86% complete (19/22) 121.99 tests/sec ✔ Agent completed: Safari (6.0) / Mac OS
Testing... | 95% complete (21/22) 115.40 tests/sec ✔ Agent completed: Chrome (22.0.1221.0) / Mac OS
Testing... \ 100% complete (22/22) 115.23 tests/sec 504 tests passed! (9164ms)

Yeti exits automatically when all tests complete. If test failures occur, Yeti will exit with a non-zero status code.

Code coverage

Yeti automatically includes a line coverage summary if your tests were instrumented with YUI Test Coverage.

✔ Testing started on Safari (6.0) / Mac OS
Testing... \ 13% complete (10/60) 11.85 tests/sec 44% line coverage


Yeti will disconnect a browser if it does not record any activity from it for 45 seconds. You can adjust this interval with the --timeout option.

This will run Yeti with a 120 second timeout:

$ yeti --timeout 120 test.html

Query string parameters

You can specify query string parameters to add to your test URLs. This can be used to pass information to your tests that control its behavior.

This will append ?fliter=coverage to your tests, which is used by the tests for the YUI Library to trigger loading instrumented code.

$ yeti --query 'filter=coverage' test/*.html

Error handling

Yeti will report an uncaught exceptions as Script Errors.

Yeti enforces No-Quirks Mode in your tests because it may impact DOM-related APIs. Add a DOCTYPE to your test document to fix this.

Mobile testing made easy

When combined with localtunnel, mobile testing is simple. If you're not dealing with sensitive information, startup your Yeti Hub and then run:

$ localtunnel 9000
   Port 9000 is now publicly accessible from ...

You can then visit that URL on your mobile (or any other) device and have it run new tests.

Yeti Hub

To save time, start a Yeti Hub.

$ yeti --server
Yeti Hub listening on port 9000.

Point browsers at your local Yeti on port 9000. Now, you're ready to run tests without having to reconnect browsers each time.

Starting Yeti in another terminal will connect to that Hub instead of starting a new one and will begin testing immediately if browsers are already connected.

$ yeti test/*.html
Connected to http://localhost:9000
  Agent connected: Chrome (22.0.1221.0) / Mac OS
  Agent connected: Safari (6.0) / Mac OS
✔ Testing started on Chrome (22.0.1221.0) / Mac OS, Safari (6.0) / Mac OS
Testing... / 68% complete (15/22) 98.84 tests/sec ✔ Agent completed: Chrome (22.0.1221.0) / Mac OS
Testing... | 95% complete (21/22) 91.65 tests/sec ✔ Agent completed: Safari (6.0) / Mac OS
Testing... \ 100% complete (22/22) 91.60 tests/sec 504 tests passed! (11529ms)


Your Yeti Hub can be shared with other developers.

First, I'll start a Hub on on port 80.

$ yeti --server --port 80

Go ahead and point a few browsers there.

Now, others can connect to it from their computer like so:

$ yeti --hub test/*.html
Connected to
Waiting for agents to connect at
When ready, press Enter to begin testing.

Your pwd and your test file will be served through the Hub. Like magic.

[Hit Enter]
  Agent connected: Chrome (22.0.1221.0) / Mac OS
  Agent connected: Safari (6.0) / Mac OS
✔ Testing started on Chrome (22.0.1221.0) / Mac OS, Safari (6.0) / Mac OS
Testing... - 91% complete (20/22) 122.51 tests/sec ✔ Agent completed: Safari (6.0) / Mac OS
Testing... | 95% complete (21/22) 120.21 tests/sec ✔ Agent completed: Chrome (22.0.1221.0) / Mac OS
Testing... \ 100% complete (22/22) 120.05 tests/sec 504 tests passed! (8763ms)

This makes it really simple to setup an ad-hoc testing lab shared with your team.


Here's a breakdown of all available CLI options.

  • query (String) Query string parameters to pass to tests.
  • timeout (Number in seconds) Test timeout.
  • hub (URL) Location of the Yeti Hub to use. Set to false or specify --no-hub to override a configuration file.
  • server Starts a Yeti Hub.
  • port (Number) Yeti Hub will listen to this port.
  • loglevel (debug or info) Print debugging information.
  • help Print usage.
  • version Print the Yeti version.

Configuration file

You may use place JSON in a .yeti.json file to set project or user specific configuration.

Yeti will look for .yeti.json in these places:

  • Recursively starting in the directory you start Yeti
  • In your home folder

Here is an example .yeti.json for the YUI project, which is placed in the repositiory root:

    "hub": "",
    "basedir": ".",
    "glob": "**/tests/unit/*.html"

Here is the breakdown of these settings:

  • The hub option defines a Yeti Hub URL to use.
  • The basedir option indicates that the directory where .yeti.json lives is permitted to serve files to the Yeti Hub.
  • The glob option defines a pattern to search for test files.

These settings let YUI developers simply run yeti inside of the project directory to run tests. Since all tests in the project match the glob pattern, the yeti command works for specific components as well as for the entire project.

This configuration can be overridden on the command line. For example, to ignore the hub setting, you can run Yeti with --no-hub.

Yeti API

You can require("yeti") inside your application to script Yeti for your own use.

For API documentation:

  • Run make html to build HTML documentation to ./build_docs.
  • Review code comments inside lib/yeti.js, lib/client.js and lib/hub/index.js.

Yeti follows Semantic Versioning but is currently at a 0.x.y release. The public API is not stable. There will be changes.


Yeti should work on all platforms supported by Node.js. It's tested on Linux and OS X.

You must start Yeti's client in the directory you'll be serving tests from. For security reasons, Yeti will reject requests that try to access files outside of the directory you start Yeti in.

Install latest Yeti snapshot

You can install the latest in-development snapshot of Yeti easily, too:

npm install -g

This will install Yeti as it exists on the yui/yeti GitHub repository. You can check the stability of the Yeti snapshot by checking yui/yeti on Travis.

Develop Yeti

Do you want to add new features or fix bugs in Yeti itself? We made it easy for you to hack on Yeti.

Experimental: Develop on Windows

After running npm install, replace the make commands below with .\jake.bat to use the experimental Jake tasks that are Windows ready.


Install dependencies

Clone Yeti.

git clone
cd yeti

Install Yeti's dependencies.

npm install

Run tests & code coverage

Yeti's automated tests require PhantomJS. You can download PhantomJS source or pre-built binaries from their website. Make sure the phantomjs binary is installed in your PATH.

make test
make coverage

The latter command uses JSCoverage for Node.js, which will be built and installed to ./tools/jscoverage.


make lint

You may also run the linter on individual files with ./go lint:

./go lint test/blizzard.js

Yeti uses JSHint to analyze code for problems. See .jshintrc for options used by Yeti.


Requires Google Chrome Canary and OS X.

Profile the Yeti Hub:

./go profile --server

Using ./go profile without --server to profile the Yeti client requires an interactive terminal, which does not yet work.

HTML documentation


Yeti uses Selleck to generate its website. Selleck files are located in doc/.

make html

Documentation will be built to build_docs/.

JavaScript API

Yeti uses YUIDocJS to generate API documentation from inline JSDoc comment blocks.

make html-api

Documentation will be built to build_docs/api/everything/.

Contribute to Yeti


Bugs & Feedback

Open a ticket on's Yeti Issue Tracker to report bugs or feature requests.


Yeti is free to use under YUI's BSD license. See the LICENSE file or the YUI license page for license text and copyright information.