# testswarm

> Nodejs module for interacting with TestSwarm

Latest version **1.1.2** (published 2020-06-10) · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2020-06-10 |
| First published | 2012-04-28 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 14.8 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 18 |
| Author | Jörn Zaefferer |
| Maintainers | jzaefferer, krinkle |
| Keywords | api, testswarm |

## Links

- npm: https://www.npmjs.com/package/testswarm
- Repository: https://github.com/jzaefferer/node-testswarm
- Issues: https://github.com/jzaefferer/node-testswarm/issues
- npm.io page: https://npm.io/package/testswarm

## Dependencies (1)

- [request](https://npm.io/package/request.md) ~2.88.0

## Recent versions

- 1.1.2 (latest) — 2020-06-10
- 1.1.1 — 2020-06-06
- 1.1.0 — 2013-07-27
- 1.0.4 — 2013-05-14
- 1.0.3 — 2013-04-30
- 1.0.0 — 2013-03-07
- 1.0.1 — 2013-03-07
- 1.0.0-alpha — 2013-01-03
- 0.3.0 — 2012-12-07
- 0.2.3 — 2012-06-16
- 0.2.2 — 2012-05-02
- 0.2.1 — 2012-05-01
- 0.2.0 — 2012-04-30
- 0.1.1 — 2012-04-28
- 0.1.0 — 2012-04-28

## README

[![Build Status](https://travis-ci.org/jzaefferer/node-testswarm.svg?branch=master)](https://travis-ci.org/jzaefferer/node-testswarm) [![NPM version](https://badge.fury.io/js/testswarm.svg)](http://badge.fury.io/js/testswarm)

# node-testswarm

Nodejs module for interacting with TestSwarm

## Getting Started
Install the module with:

	npm install --save-dev testswarm

```javascript
var testswarm = require( "./lib/testswarm" ),
	testUrl = "http://localhost/jquery-core/test/",
	runs = {};

["attributes", "callbacks"].forEach(function (suite) {
	runs[suite] = testUrl + "?module=" + suite;
});

testswarm.createClient({
	url: "http://localhost/testswarm/"
})
.addReporter( testswarm.reporters.cli )
.auth({
	id: "example",
	token: "yourauthtoken"
})
.addjob(
	{
		name: "node-testswarm test job",
		runs: runs,
		browserSets: [ "example" ],
	}, function( err, passed ) {
		if ( err ) {
			throw err;
		}
		process.exit( passed ? 0 : 1 );
	}
);
```

For local testing, copy `sample-test.js` to `test.js` and modify to match your local TestSwarm setup.

## API

### createClient({ url })

* `Object config`
 - `String url` - Url to root of TestSwarm install.

### Client#addReporter( reporter )

* `Object reporter` - usually `testswarm.reporters.cli`, unless you want to use a custom reporter

### Client#auth({ id, token })

* `Object auth`
 - `String id` - Username of TestSwarm account.
 - `String token` - Authentication token of account.

### Client#addjob( options, callback )

* `Object options`
 - `String name` - name of this job
 - `Number runMax` - [optional] how often failed tests should rerun
 - `Object runs` -  Run urls by run name.
 - `Array|String browserSets` - which sets to test against
 - `Number pollInterval` -  [optional] In milliseconds, default 5 seconds.
 - `Number timeout` -  [optional] In milliseconds, default 15 minutes.
* `Function( Object err, Boolean passed, Object results ) callback`

## License
Copyright (c) 2014 Jörn Zaefferer
Licensed under the MIT license.

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