summaryrefslogtreecommitdiffstats
path: root/docs/plugins/testing.md
blob: 4cd2c69a3a26b39fe2324c93736ef0378e764a47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Testing your plugin

### Testing your plugin locally

Testing your plugin on your book before publishing it is possible using [npm link](https://docs.npmjs.com/cli/link).

In the plugin's folder, run:

```
$ npm link
```

Then in your book's folder:

```
$ npm link gitbook-plugin-<plugin's name>
```

### Unit testing on Travis

[gitbook-tester](https://github.com/todvora/gitbook-tester) makes it easy to write **Node.js/Mocha** unit tests for your plugins. Using [Travis.org](https://travis.org), tests can be run on each commits/tags.