ant-tool / atool-test

Test tool based on dora & webpack, run tests with browser
14 stars 4 forks source link

atool-test

NPM version Build Status Coverage Status

Simple configuration, focus more on the writing tests.

Built-in

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

Custom Assert

atool-test --no-chai

// 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.