Use a local data directory specific for reg testing.

This commit is contained in:
Braydon Fuller 2015-07-21 17:32:24 -04:00
parent 072c109174
commit bcc3a4c2e1
4 changed files with 45 additions and 29 deletions

View File

@ -11,4 +11,4 @@ before_install:
- git config --global user.email "dev@bitpay.com"
- git config --global user.name "BitPay, Inc."
script:
- mocha -R spec integration/regtest.js
- _mocha -R spec integration/regtest.js

View File

@ -0,0 +1,8 @@
server=1
whitelist=127.0.0.1
txindex=1
rpcallowip=127.0.0.1
rpcuser=bitcoin
rpcpassword=local321

View File

@ -5,6 +5,7 @@
var chai = require('chai');
var bitcore = require('bitcore');
var rimraf = require('rimraf');
var bitcoind;
/* jshint unused: false */
@ -17,13 +18,16 @@ describe('Basic Functionality', function() {
before(function(done) {
this.timeout(30000);
rimraf('./data/regtest', function(err) {
if (err) {
throw err;
}
bitcoind = require('../').daemon({
datadir: process.env.BITCOINDJS_DIR || '~/.bitcoin',
network: 'regtest',
server: true,
rpcuser: 'bitcoin',
rpcpassword: 'local321',
rpcallowip: '127.0.0.1'
datadir: './data',
network: 'regtest'
});
bitcoind.on('error', function(err) {
@ -46,9 +50,10 @@ describe('Basic Functionality', function() {
pass: 'local321'
});
client.generate(100, function(err, result) {
console.log('err', err);
console.log('result', result);
client.generate(100, function(err) {
if (err) {
throw err;
}
done();
});
@ -56,6 +61,8 @@ describe('Basic Functionality', function() {
});
});
after(function(done) {
this.timeout(20000);
bitcoind.stop(function(err, result) {

View File

@ -55,6 +55,7 @@
"chai": "^3.0.0",
"mocha": "~1.16.2",
"proxyquire": "^1.3.1",
"rimraf": "^2.4.2",
"sinon": "^1.15.4"
}
}