# poi-plugin-transform-test-files

> How does this work:

Latest version **10.0.0-alpha.0** (published 2018-02-08) · 0 weekly downloads

## Install

```sh
npm install poi-plugin-transform-test-files
pnpm add poi-plugin-transform-test-files
yarn add poi-plugin-transform-test-files
bun add poi-plugin-transform-test-files
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 10.0.0-alpha.0 |
| Published | 2018-02-08 |
| First published | 2018-02-08 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5156 |
| Author | EGOIST |
| Maintainers | rem |

## Links

- npm: https://www.npmjs.com/package/poi-plugin-transform-test-files
- Repository: https://github.com/egoist/poi
- Homepage: https://github.com/egoist/poi#readme
- Issues: https://github.com/egoist/poi/issues
- npm.io page: https://npm.io/package/poi-plugin-transform-test-files

## Dependencies (1)

- [globby](https://npm.io/package/globby.md) ^7.0.0

## Recent versions

- 10.0.0-alpha.0 (latest) — 2018-02-08

## README

# poi-plugin-transform-test-files

How does this work:

- Transform your test files with Poi.
- Run custom test framework against transformed test file.

## Install

```bash
yarn add poi-plugin-transform-test-files --dev
```

## Usage

Activate it in config file:

```js
// poi.config.js
module.exports = {
  plugins: [
    require('poi-plugin-transform-test-files')(/* options */)
  ]
}
```

Then you can compile test files, by default it looks for `**/*.test.js` from the root, otherwise you could specify the directory by `--baseDir`:

```bash
poi test
# or somewhere else
poi test "src/*.test.js" "lib/*.spec.js"
# or from certain directory
poi test --baseDir "./test"
```

The default generated test files can be found at in place as `[name].transfromed.js`, you can finally run it with your favorite test framework like AVA:

```bash
poi test && ava ./test/example.test.transformed.js
```

If you want to bundle test files to certain directory, rather than at the same place as source. Please check the [outputDir](#outputdir) option below. 

**Note:** You might put `*.transfromed.js` in `.gitignore` file.

## Options

### testFiles

Type: `string` `Array`<br>
Default: `**/*.{test,spec}.js`

### ignoreFiles

Type: `Array`<br>
Default: `['!**/node_modules/**', '!**/vendor/**'])`

### baseDir

Type: `string`<br>
Default: `cwd`

The directory to search `testFiles`.

### outputDir

Type: `string`  
Default: `baseDir`

The directory of transfromed test files.
  
```js
// poi.config.js
module.exports = {
  plugins: [
    require('poi-plugin-transform-test-files')({
      outputDir: './test/_build'
    })
  ]
}
```

## LICENSE

MIT &copy; [EGOIST](https://github.com/egoist)

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