Merge pull request #13 from matiu/feature/grunt-enhacements
Enhacements in gruntfile
This commit is contained in:
commit
d08d456eea
29
Gruntfile.js
29
Gruntfile.js
|
@ -1,6 +1,16 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
module.exports = function(grunt) {
|
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
|
// Project Configuration
|
||||||
grunt.initConfig({
|
grunt.initConfig({
|
||||||
pkg: grunt.file.readJSON('package.json'),
|
pkg: grunt.file.readJSON('package.json'),
|
||||||
|
@ -29,6 +39,11 @@ module.exports = function(grunt) {
|
||||||
options: {
|
options: {
|
||||||
livereload: true
|
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: {
|
jshint: {
|
||||||
|
@ -43,7 +58,7 @@ module.exports = function(grunt) {
|
||||||
options: {
|
options: {
|
||||||
reporter: 'spec',
|
reporter: 'spec',
|
||||||
},
|
},
|
||||||
src: ['test/*.js']
|
src: ['test/**/*.js'],
|
||||||
},
|
},
|
||||||
|
|
||||||
nodemon: {
|
nodemon: {
|
||||||
|
@ -51,9 +66,9 @@ module.exports = function(grunt) {
|
||||||
options: {
|
options: {
|
||||||
file: 'server.js',
|
file: 'server.js',
|
||||||
args: [],
|
args: [],
|
||||||
ignoredFiles: ['public/**'],
|
ignoredFiles: ['public/**', 'test/**'],
|
||||||
watchedExtensions: ['js'],
|
watchedExtensions: ['js'],
|
||||||
nodeArgs: ['--debug'],
|
// nodeArgs: ['--debug'],
|
||||||
delayTime: 1,
|
delayTime: 1,
|
||||||
env: {
|
env: {
|
||||||
PORT: 3000
|
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.
|
//Making grunt default to force in order not to break the project.
|
||||||
grunt.option('force', true);
|
grunt.option('force', true);
|
||||||
|
|
||||||
|
|
|
@ -181,7 +181,6 @@ TransactionSchema.methods.queryInfo = function (next) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
tx.outs.forEach( function(i) {
|
tx.outs.forEach( function(i) {
|
||||||
var n = util.valueToBigInt(i.v).toNumber();
|
var n = util.valueToBigInt(i.v).toNumber();
|
||||||
valueOut = valueOut.add(n);
|
valueOut = valueOut.add(n);
|
||||||
|
|
|
@ -1,9 +1,16 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
db: "mongodb://localhost/mystery-test",
|
db: "mongodb://localhost/mystery-dev",
|
||||||
port: 3001,
|
|
||||||
app: {
|
app: {
|
||||||
name: "Mystery - Test"
|
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',
|
||||||
|
}
|
||||||
|
|
|
@ -26,10 +26,9 @@ describe('Block fromHashWithInfo', function(){
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it('should poll block\'s info from mongoose', function(done) {
|
it('should poll block\'s info from mongoose', function(done) {
|
||||||
console.log('asdasd');
|
|
||||||
var block2 = Block.fromHashWithInfo(TESTING_BLOCK, function(err, b2) {
|
var block2 = Block.fromHashWithInfo(TESTING_BLOCK, function(err, b2) {
|
||||||
console.log('333');
|
|
||||||
if (err) done(err);
|
if (err) done(err);
|
||||||
|
|
||||||
assert.equal(b2.hash, TESTING_BLOCK);
|
assert.equal(b2.hash, TESTING_BLOCK);
|
||||||
|
@ -37,6 +36,7 @@ console.log('333');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it('should poll block\'s info from bitcoind', function(done) {
|
it('should poll block\'s info from bitcoind', function(done) {
|
||||||
var block2 = Block.fromHashWithInfo(TESTING_BLOCK, function(err, b2) {
|
var block2 = Block.fromHashWithInfo(TESTING_BLOCK, function(err, b2) {
|
||||||
if (err) done(err);
|
if (err) done(err);
|
||||||
|
|
Loading…
Reference in New Issue