Enhacements in gruntfile

This commit is contained in:
Matias Alejo Garcia 2014-01-09 19:49:48 -03:00
parent 38e93bb341
commit c41446b131
4 changed files with 31 additions and 18 deletions

View File

@ -1,6 +1,16 @@
'use strict';
module.exports = function(grunt) {
//Load NPM tasks
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-nodemon');
grunt.loadNpmTasks('grunt-concurrent');
grunt.loadNpmTasks('grunt-env');
// Project Configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
@ -29,6 +39,11 @@ module.exports = function(grunt) {
options: {
livereload: true
}
},
test: {
// we monitor only app/models/* because we have test for models only now
files: ['test/**/*.js', 'test/*.js','app/models/*.js'],
tasks: ['test'],
}
},
jshint: {
@ -43,7 +58,7 @@ module.exports = function(grunt) {
options: {
reporter: 'spec',
},
src: ['test/*.js']
src: ['test/**/*.js'],
},
nodemon: {
@ -51,9 +66,9 @@ module.exports = function(grunt) {
options: {
file: 'server.js',
args: [],
ignoredFiles: ['public/**'],
ignoredFiles: ['public/**', 'test/**'],
watchedExtensions: ['js'],
nodeArgs: ['--debug'],
// nodeArgs: ['--debug'],
delayTime: 1,
env: {
PORT: 3000
@ -75,14 +90,6 @@ module.exports = function(grunt) {
}
});
//Load NPM tasks
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-nodemon');
grunt.loadNpmTasks('grunt-concurrent');
grunt.loadNpmTasks('grunt-env');
//Making grunt default to force in order not to break the project.
grunt.option('force', true);

View File

@ -181,7 +181,6 @@ TransactionSchema.methods.queryInfo = function (next) {
});
}
tx.outs.forEach( function(i) {
var n = util.valueToBigInt(i.v).toNumber();
valueOut = valueOut.add(n);

15
config/env/test.js vendored
View File

@ -1,9 +1,16 @@
'use strict';
module.exports = {
db: "mongodb://localhost/mystery-test",
port: 3001,
db: "mongodb://localhost/mystery-dev",
app: {
name: "Mystery - Test"
}
}
},
bitcoind: {
user: 'mystery',
pass: 'real_mystery',
protocol: 'http',
host: process.env.BITCOIND_HOST || '127.0.0.1',
port: process.env.BITCOIND_PORT || '8332',
},
network: 'testnet',
}

View File

@ -26,10 +26,9 @@ describe('Block fromHashWithInfo', function(){
done();
});
it('should poll block\'s info from mongoose', function(done) {
console.log('asdasd');
var block2 = Block.fromHashWithInfo(TESTING_BLOCK, function(err, b2) {
console.log('333');
if (err) done(err);
assert.equal(b2.hash, TESTING_BLOCK);
@ -37,6 +36,7 @@ console.log('333');
});
});
it('should poll block\'s info from bitcoind', function(done) {
var block2 = Block.fromHashWithInfo(TESTING_BLOCK, function(err, b2) {
if (err) done(err);