How to run the tests in bitcore-node?

(Michael Angerman) #1

I am trying to run the tests in bitcore-node but am not being successful.

Can you please outline the steps I need to go through to see the tests run.

After running npm install I try running mocha at the command line but see this error message.

Error: Could not locate the bindings file. Tried:
→ /tmp35/bitcore-node/build/bitcoind.node
→ /tmp35/bitcore-node/build/Debug/bitcoind.node
→ /tmp35/bitcore-node/build/Release/bitcoind.node
→ /tmp35/bitcore-node/out/Debug/bitcoind.node
→ /tmp35/bitcore-node/Debug/bitcoind.node
→ /tmp35/bitcore-node/out/Release/bitcoind.node
→ /tmp35/bitcore-node/Release/bitcoind.node
→ /tmp35/bitcore-node/build/default/bitcoind.node
→ /tmp35/bitcore-node/compiled/0.12.7/darwin/x64/bitcoind.node
at bindings (/tmp35/bitcore-node/node_modules/bindings/bindings.js:88:9)
at Object. (/tmp35/bitcore-node/lib/services/bitcoind.js:5:35)

Thanks for your help,
Michael

0 Likes

(Braydon Fuller) #2

You may need to run node-gyp -d rebuild

0 Likes

(Braydon Fuller) #3

Also note: if you want to run the tests in integration/regtest.js, you’ll need to recompile bitcoin and the bindings with an environment variable set: export BITCORENODE_ENV=test.

0 Likes