## KARMA PLUGINS

All karma plugins are automatically loaded. Karma plugins are npm packages that
are installed as peers to bb-test, and begin with 'karma-'.

## BROWSERS

Chrome is the default launcher used, but there is support for any karma launcher.

Because karma plugins are loaded automatically, just install the correct plugin
for the browser you want to launch. For example, you can install the Firefox
Launcher and run bb-test unit with --browsers=Firefox. Make sure to consult
the launchers documentation for the correct name of the browser.

It can also accept a comma separated list of browsers.

## LOADING PREBUILT FILES

Karma has an option for loading addition files in the browser. bb-test has a similar
option where you can load prebuilt files in the page (even if they're not directly
imported into one of the items you're testing).

For example, if you have a config-bb-module-loader in your project, which relies
on the vendor-bb-systemjs item to already be loaded on the page, you can tell bb-test
to always include vendor-bb-systemjs on the page.

## TEST PLUGINS

bb-test supports it's own set of test plugins. A bb-test plugin is an npm
package that begins with @bb-cli/bb-test-plugin-. To load a plugin just provide
that last part of the name to bb-test unit.

For example, there is an angular-mocks plugin that enables you to use ngmock
in your tests, and can be loaded via --test-plugins=ngmock
https://www.npmjs.com/package/@bb-cli/bb-test-plugin-ngmock

# EXAMPLES

Install Firefox launcher and run with firefox:

```bash
  $ npm install -g karma-firefox-launcher
  $ bb-test unit --browsers Firefox
```

Or run with Firefox AND Chrome:

```bash
  $ bb-test unit --browsers Firefox,Chrome
```

Install and run with test plugin @bb-cli/bb-test-plugin-ngmock
(which adds support for angular-mocks):

```bash
  $ npm install -g @bb-cli/bb-test-plugin-ngmock
  $ bb-test unit --test-plugins ngmock
```

Run tests with support for compiling sass files:

```bash
  $ npm install -g @bb-cli/bb-build-plugin-sass
  $ bb-test unit --build-plugins sass
```

Create html & lcov coverage in reports/ dir, and print coverage to stdout:

```bash
  $ bb-test unit --coverage text-summary,html,lcov
```

Combining aliases for test-plugins, build-plugins, browsers, and coverage as
you might do on a jenkins machine:

```bash
  $ bb-test unit -t ngmock -b sass -B PhantomJS --coverage lcov,text-summary
```

Instead of the current directory, look for CXP source items in src/ with
additional prebuilt dependencies in prebuilt/. Note: this will still search
for dependencies in node_modules and target/backbase:

```bash
  $ bb-test unit src/ --prebuilt prebuilt/
```

Load vendor-bb-systemjs into the browser so the System global is defined:

```bash
  $ bb-test unit --load-prebuilt vendor-bb-systemjs
```