# gulp-sf-run-test

> gulp plugin for running apex-tests on salesforce

Latest version **0.9.2** (published 2016-01-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install gulp-sf-run-test
pnpm add gulp-sf-run-test
yarn add gulp-sf-run-test
bun add gulp-sf-run-test
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.9.2 |
| Published | 2016-01-04 |
| First published | 2015-12-30 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 10 |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Satoshi Haga |
| Maintainers | hagasatoshi |

## Links

- npm: https://www.npmjs.com/package/gulp-sf-run-test
- Repository: https://github.com/hagasatoshi/gulp-sf-run-test
- Homepage: https://github.com/hagasatoshi/gulp-sf-run-test#readme
- Issues: https://github.com/hagasatoshi/gulp-sf-run-test/issues
- npm.io page: https://npm.io/package/gulp-sf-run-test

## Dependencies (10)

- [fs](https://npm.io/package/fs.md) 0.0.2
- [sleep](https://npm.io/package/sleep.md) ^3.0.0
- [dotenv](https://npm.io/package/dotenv.md) ^1.2.0
- [xml2js](https://npm.io/package/xml2js.md) ^0.4.15
- [jsforce](https://npm.io/package/jsforce.md) ^1.5.0
- [bluebird](https://npm.io/package/bluebird.md) ^3.1.1
- [through2](https://npm.io/package/through2.md) ^2.0.0
- [gulp-util](https://npm.io/package/gulp-util.md) ^3.0.7
- [date-utils](https://npm.io/package/date-utils.md) ^1.2.17
- [underscore](https://npm.io/package/underscore.md) ^1.8.3

## Recent versions

- 0.9.2 (latest) — 2016-01-04
- 0.9.1 — 2015-12-30
- 0.9.0 — 2015-12-30
- 0.5.0 — 2015-12-30

## README

# gulp-sf-run-test
gulp task for running apex-tests

## Usage


First install `gulp-sf-run-test` as a development dependency:

```shell
npm install gulp-sf-run-test --save-dev
```

Create .env file that saves credential information of your Salesforce account:

```bash
SFDC_HOST=your Salesforce host. https://ap2.salesforce.com, for example.
SFDC_USERNAME=your Salesforce username. satoshi.haga.github@gmail.com, for example.
SFDC_PASSWORD=your Salesorce password.
SFDC_TOKEN=your Salesforce security token if required.

```

Then, add it to your gulpfile.js:

```javascript
var sfTest = require('gulp-sf-run-test');
```

Then create a task that uses it:
 - package.xml : Salesforce standard manifest file.

```javascript
gulp.task('sf-test', function(){
    return gulp.src('./src/package.xml')
        .pipe(sfTest())
        .pipe(gulp.dest('./result/'));
});
```

Example of package.xml. Please make sure that both of production and test classes are needed:

```xml

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>XXXXXX</members>
        <members>XXXXXXTest</members>
        <members>YYYYYY</members>
        <members>YYYYYYTest</members>
        <name>ApexClass</name>
    </types>
    <version>34.0</version>
</Package>
```

Example of test result:

```csv
className,coveredRate,
XXXXXX,52,
YYYYYY,43,
```

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