# atool-test

> Unit testing tool based on dora & mocha & webpack

Latest version **0.5.5** (published 2017-09-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install atool-test
pnpm add atool-test
yarn add atool-test
bun add atool-test
```

Provides the command `atool-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.5.5 |
| Published | 2017-09-13 |
| First published | 2015-12-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 21 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Author | rjmuqiang@gmail.com |
| Maintainers | silentcloud, zinkey |
| Keywords | testing, webpack, istanbul, mocha, react, babel6, dora |

## Links

- npm: https://www.npmjs.com/package/atool-test
- Repository: https://github.com/ant-tool/atool-test
- Issues: https://github.com/ant-tool/atool-test/issues
- npm.io page: https://npm.io/package/atool-test

## Dependencies (21)

- [chai](https://npm.io/package/chai.md) ~3.5.0
- [dora](https://npm.io/package/dora.md) ~0.4.2
- [exeq](https://npm.io/package/exeq.md) ^2.4.0
- [glob](https://npm.io/package/glob.md) ^7.0.0
- [chalk](https://npm.io/package/chalk.md) ^1.1.1
- [mocha](https://npm.io/package/mocha.md) ^2.4.5
- [sinon](https://npm.io/package/sinon.md) ~1.17.3
- [webpack](https://npm.io/package/webpack.md) ~1.12.14
- [chokidar](https://npm.io/package/chokidar.md) ^1.4.3
- [istanbul](https://npm.io/package/istanbul.md) ~0.4.2
- [commander](https://npm.io/package/commander.md) ~2.9.0
- [koa-router](https://npm.io/package/koa-router.md) ^5.4.0
- [sinon-chai](https://npm.io/package/sinon-chai.md) ~2.8.0
- [atool-build](https://npm.io/package/atool-build.md) ~0.11.0
- [atool-monitor](https://npm.io/package/atool-monitor.md) 0.x
- [object-assign](https://npm.io/package/object-assign.md) ^4.0.1
- [babel-polyfill](https://npm.io/package/babel-polyfill.md) ~6.9.1
- [isparta-loader](https://npm.io/package/isparta-loader.md) ^2.0.0
- [mocha-phantomjs](https://npm.io/package/mocha-phantomjs.md) ^4.0.2
- [html-webpack-plugin](https://npm.io/package/html-webpack-plugin.md) ^2.20.0
- [koa-webpack-dev-middleware](https://npm.io/package/koa-webpack-dev-middleware.md) ^1.1.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.5.5 (latest) — 2017-09-13
- 0.5.4 — 2017-09-13
- 0.5.3 — 2017-05-04
- 0.5.2 — 2017-02-09
- 0.5.1 — 2016-08-09
- 0.5.0 — 2016-08-08
- 0.4.19 — 2016-08-04
- 0.4.18 — 2016-08-04
- 0.4.17 — 2016-08-04
- 0.4.16 — 2016-08-03
- 0.4.15 — 2016-08-03
- 0.4.14 — 2016-06-21
- 0.4.13 — 2016-06-13
- 0.4.12 — 2016-05-26
- 0.4.12-beta — 2016-05-26
- … 25 more at https://npm.io/package/atool-test/versions

## README

# atool-test

[![NPM version](https://img.shields.io/npm/v/atool-test.svg?style=flat)](https://npmjs.org/package/atool-test)
[![Build Status](https://img.shields.io/travis/ant-tool/atool-test.svg?style=flat)](https://travis-ci.org/ant-tool/atool-test)
[![Coverage Status](https://img.shields.io/coveralls/ant-tool/atool-test.svg?style=flat)](https://coveralls.io/r/ant-tool/atool-test)

Simple configuration, focus more on the writing tests.

## Built-in

- [mocha](http://mochajs.org/)
- [chai](http://chaijs.com/api)
- [sinon](http://sinonjs.org/)

## Usage

>  Add `-test.js` or `-spec.js` suffix with your test files

```
"srcipts": {
  "test": "atool-test"
}
```

with options:

```
atool-test --port 9888 --no-chai --no-coverage --keep
```

## Options

- `-p, --port`: server port, default is 9876;
- `--no-coverage`: without coverage output;
- `--no-chai`: run test without chai;
- `-k, --keep`: keep process after tests, for browser test;
- `--config <path>`: custom config path, default is webpack.config.js';
- [mocha-phantomjs options](https://github.com/nathanboktae/mocha-phantomjs#usage)

## Custom Assert

>  atool-test --no-chai

- expectjs: `npm install expect.js --save-dev`
- shouldjs: `npm install should --save-dev`

```
// test code
import expect from 'expect.js';
```

## Part Of test Files

If you want to test with part of files, custom `cwd/webpack.config.js`:

```
module.exports = function(webpackConfig) {
  webpackConfig.atoolTestSpec = ['./tests/moduleA-test.js', './tests/**/*-spec.js'];
  return webpackConfig;
};
```

support glob files;

## Html Extra Files

custom `cwd/webpack.config.js`:

```
module.exports = function(webpackConfig) {
  webpackConfig.htmlWebpackPlugin = {
    files: {
      js: ['xx.js'],
      css: ['xx.css']
    }
  };
  return webpackConfig;
};
```
base file path: `/tests`


## Browser Test & Debug

  Run with `--keep && --no-coverage` option, open `http://127.0.0.1:${port}/tests/runner.html` in your browser.

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