Skip to content

Commit

Permalink
trying to fix node tests now
Browse files Browse the repository at this point in the history
  • Loading branch information
maraoz committed Mar 10, 2014
1 parent a2e6e88 commit d7529a8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions bitcore.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
module.exports.bignum = require('bignum');
module.exports.base58 = require('base58-native');
module.exports.buffertools = require('buffertools');
module.exports.Buffer = Buffer;

module.exports.config = require('./config');
module.exports.const = require('./const');
Expand All @@ -34,12 +33,17 @@ module.exports.PrivateKey = require('./PrivateKey');
module.exports.RpcClient = require('./RpcClient');
module.exports.Wallet = require('./Wallet');
module.exports.WalletKey = require('./WalletKey');
module.exports.Buffer = Buffer;

if (typeof process.versions === 'undefined') {
// Browser specific
module.exports.bignum.config({EXPONENTIAL_AT: 9999999, DECIMAL_PLACES: 0, ROUNDING_MODE: 1});
} else {
// Node specific
// module.exports.PeerManager = function () {
// throw new Error('PeerManager not availabe in browser Bitcore, under .bitcore. Use it with: require(\'PeerManager\');');
// };
}
else {
// Nodejs specific
module.exports.PeerManager = require('./PeerManager');
}

2 changes: 1 addition & 1 deletion browser/browserify.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var modules = [
];

var opts = {};
//opts.pack = pack;
opts.pack = pack;
opts.debug = true;
opts.standalone = 'bitcore';
opts.insertGlobals = true;
Expand Down
2 changes: 1 addition & 1 deletion test/test.Address.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

var chai = chai || require('chai');
var bitcore = bitcore || require('./bitcore');
var bitcore = bitcore || require('../bitcore');

var should = chai.should();

Expand Down

0 comments on commit d7529a8

Please sign in to comment.