2015-09-29 11:15:49 -07:00
# Development & Testing
2015-08-31 06:00:00 -07:00
To run all of the JavaScript tests:
```bash
npm run test
```
If you do not already have mocha installed:
```bash
npm install mocha -g
```
2016-04-11 09:59:36 -07:00
To run the regression tests:
2015-08-31 06:00:00 -07:00
```bash
2016-04-11 09:59:36 -07:00
mocha -R spec regtest/bitcoind.js
2015-08-31 06:00:00 -07:00
```
2016-04-11 09:59:36 -07:00
To be able to debug bitcoind you'll need to have `gdb` and `node` compiled for debugging with gdb using `--gdb` (sometimes called node_g), and you can then run:
2015-08-31 06:00:00 -07:00
```bash
$ gdb --args node examples/node.js
```
To run mocha from within gdb (notice `_mocha` and not `mocha` so that the tests run in the same process):
2015-10-19 10:59:58 -07:00
2015-08-31 06:00:00 -07:00
```bash
$ gdb --args node /path/to/_mocha -R spec integration/regtest.js
```
To run the benchmarks:
```bash
$ cd benchmarks
$ node index.js
2015-09-29 11:15:49 -07:00
```