1 | # @tractor-plugins/mocha-specs
|
2 |
|
3 | Plugin for [**tractor**](https://github.com/TradeMe/tractor) for creating E2E tests with [**Mocha**](https://mochajs.org/).
|
4 |
|
5 | [![npm version](https://img.shields.io/npm/v/@tractor-plugins/mocha-specs.svg)](https://www.npmjs.com/package/@tractor-plugins/mocha-specs)
|
6 |
|
7 | ## How to install
|
8 |
|
9 | ```sh
|
10 | npm install @tractor-plugins/mocha-specs --dev
|
11 | ```
|
12 |
|
13 | ## Config
|
14 |
|
15 | ```javascript
|
16 | // tractor.conf.js
|
17 | module.exports = {
|
18 | // ...
|
19 | mochaSpecs: {
|
20 |
|
21 | },
|
22 | // ...
|
23 | };
|
24 | ```
|
25 |
|
26 | For more information [see here](./docs/configuration.md)
|
27 |
|
28 | ## Development
|
29 |
|
30 | To set up development, just run `yarn` from the root of the repository. You can then run the following commands from within the directory, or use [`lerna run`](https://github.com/lerna/lerna/tree/master/commands/run) with [`--scope="@tractor-plugins/mocha-specs`](https://www.npmjs.com/package/@lerna/filter-options).
|
31 |
|
32 | ### Build
|
33 |
|
34 | To build the whole package:
|
35 |
|
36 | ```sh
|
37 | yarn build
|
38 | ```
|
39 |
|
40 | ### Test
|
41 |
|
42 | To run unit tests:
|
43 |
|
44 | ```sh
|
45 | yarn test
|
46 | yarn cover # with coverage
|
47 | ```
|
48 |
|
49 | To run end-to-end tests:
|
50 |
|
51 | ```sh
|
52 | yarn tractor:test # in one tab
|
53 | yarn test:e2e # in another tab
|
54 | ```
|
55 |
|
56 | To run end-to-end tests in CI mode:
|
57 |
|
58 | ```sh
|
59 | yarn test:e2e:ci # handles the starting and killing of the application for testing
|
60 | ```
|
61 |
|
62 | To start `tractor`:
|
63 |
|
64 | ```sh
|
65 | yarn tractor
|
66 | ``` |
\ | No newline at end of file |