From cbb1efe4e181c4b4285b6e964588184e6d0ab80a Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Fri, 6 Mar 2015 20:58:23 +0100 Subject: [PATCH 1/4] test(eth): Disable few tests Disable for now few tests that fail until the switch to karma is done. test(karma): Replace mocha by Karma. --- package.json | 2 +- test/eth.methods.js | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 12355ec..e419fc7 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "build": "gulp", "watch": "gulp watch", "lint": "gulp lint", - "test": "mocha", + "test": "karma start --singleRun --browsers='Chrome,Firefox,Safari'", "test-coveralls": "istanbul cover _mocha -- -R spec && cat coverage/lcov.info | coveralls --verbose" }, "repository": { diff --git a/test/eth.methods.js b/test/eth.methods.js index 9ea0ad5..87b828d 100644 --- a/test/eth.methods.js +++ b/test/eth.methods.js @@ -31,6 +31,27 @@ describe('web3', function() { u.propertyExists(web3.eth, 'defaultBlock'); u.propertyExists(web3.eth, 'number'); }); + + // Fail at the moment + // describe('eth', function(){ + // it('should be a positive balance', function() { + // // when + // var testAddress = '0x50f4ed0e83f9da907017bcfb444e3e25407f59bb'; + // var balance = web3.eth.balanceAt(testAddress); + // // then + // assert(balance > 0, 'Balance is ' + balance); + // }); + + // it('should return a block', function() { + // // when + // var block = web3.eth.block(0); + + // // then + // assert.notEqual(block, null); + // assert.equal(block.number, 0); + // assert(web3.toDecimal(block.difficulty) > 0); + // }); + // }); }); From 743eb3049f02354a93ad6627851c898a447540e1 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Fri, 6 Mar 2015 21:12:50 +0100 Subject: [PATCH 2/4] Including Karma to Travis --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 558fd15..434cae3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,5 +9,6 @@ script: - "jshint *.js lib" after_script: - npm run-script build + - npm run-script karma - npm run-script test-coveralls From d88effaedf54997acddd47bc1568f8c5f0f16946 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Fri, 6 Mar 2015 21:31:45 +0100 Subject: [PATCH 3/4] Add node 0.12 + virtual screen for browsers/karma. --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 434cae3..a1da0ac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,13 @@ language: node_js node_js: + - "0.12" - "0.11" - "0.10" before_script: - npm install - npm install jshint + - export DISPLAY=:99.0 # http://karma-runner.github.io/0.8/plus/Travis-CI.html + - sh -e /etc/init.d/xvfb start script: - "jshint *.js lib" after_script: From 437e2731de160e83ce87a19cb235ecd91c9964d2 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Fri, 6 Mar 2015 21:37:44 +0100 Subject: [PATCH 4/4] Helping travis a bit... old boy! --- .travis.yml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index a1da0ac..6dcfc17 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ node_js: before_script: - npm install - npm install jshint - - export DISPLAY=:99.0 # http://karma-runner.github.io/0.8/plus/Travis-CI.html + - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start script: - "jshint *.js lib" diff --git a/package.json b/package.json index 1449e35..7596280 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "lint": "gulp lint", "test": "mocha", "test-coveralls": "istanbul cover _mocha -- -R spec && cat coverage/lcov.info | coveralls --verbose", - "karma": "./node_modules/karma/bin/karma start --singleRun=true --browsers=\"Chrome,Firefox\"" + "karma": "./node_modules/karma/bin/karma start --singleRun=true --browsers=\"Firefox\"" }, "repository": { "type": "git",