Skip to content
This repository was archived by the owner on Dec 26, 2024. It is now read-only.

Commit 0047627

Browse files
committed
fix: make tests work better
* skip what needs skipping with a comment * replace xit with .skip
1 parent 697175e commit 0047627

File tree

4 files changed

+21
-16
lines changed

4 files changed

+21
-16
lines changed

test/methods-test.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ describe('api', function() {
158158
});
159159
// test for bug #31
160160
// see https://github.com/sebs/etherscan-api/issues/31
161-
it('contract.getabi for a contract that is not verified by etherscan: error', function(done){
162-
var api = init('test', 'ropsten', 10000);
161+
it.skip('contract.getabi for a contract that is not verified by etherscan: error', function(done){
162+
var api = init(process.env.API_KEY);
163163
var abi = api.contract.getabi('0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413');
164164
abi.then(function(){
165165
assert.false(true, 'should not be a success');
@@ -238,7 +238,8 @@ describe('api', function() {
238238
});
239239
});
240240

241-
xit('proxy.eth_sendRawTransaction', function(done){
241+
// I can not test this. Example required
242+
it.skip('proxy.eth_sendRawTransaction', function(done){
242243
var api = init(process.env.API_KEY);
243244
var res = api.proxy.eth_sendRawTransaction('0xf904808000831cfde080');
244245
res.then(function(res){
@@ -295,8 +296,8 @@ describe('api', function() {
295296
done();
296297
});
297298
});
298-
299-
xit('proxy.eth_estimateGas', function(done){
299+
// skip times out ... idk
300+
it.skip('proxy.eth_estimateGas', function(done){
300301
var api = init(process.env.API_KEY);
301302
var res = api.proxy.eth_estimateGas(
302303
'0xf0160428a8552ac9bb7e050d90eeade4ddd52843',

test/proxy-test.js

Whitespace-only changes.

test/testnet-eth-test.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
const assert = require('chai').assert;
33
const init = require('../.').init;
44
describe('testnet eth', function() {
5-
xit('eth.getminedblocks', function(done){
5+
// timeout
6+
it.skip('eth.getminedblocks', function(done){
67
var api = init(process.env.API_KEY,'morden');
78
//In testnet there are no mined blocks by this account
89
//reference - https://testnet.etherscan.io/api?module=account&action=getminedblocks&address=0x9dd134d14d1e65f84b706d6f205cd5b1cd03a46b&blocktype=blocks&apikey=YourApiKeyToken

test/testnet-methods-test.js

+13-10
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ describe('testnet methods', function () {
1010
api = init(process.env.API_KEY, 'ropsten');
1111
});
1212

13-
xit('getminedblocks', function (done) {
13+
it('getminedblocks', function (done) {
1414
var txlist = api.account.getminedblocks('0x3D6F8823Ad21CD299814B62D198d9001E67E20B3');
1515
txlist
1616
.then(function (res) {
@@ -63,7 +63,7 @@ describe('testnet methods', function () {
6363
}).catch(done);
6464
});
6565

66-
xit('txlist', function (done) {
66+
it('txlist', function (done) {
6767
/**
6868
* No transaction found in testnet
6969
* var txlist = api.account.txlist('0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae');
@@ -75,16 +75,18 @@ describe('testnet methods', function () {
7575
}).catch(done);
7676
});
7777

78-
xit('txlistinternal by hash', function (done) {
78+
it('txlistinternal by hash', function (done) {
7979
var txlist = api.account.txlistinternal('0xf2aa030a0b889706206d262377cd45489faa2ff7dedbccda3693bf6c5370ed0c');
8080
txlist.then(function (res) {
8181
assert.ok(res);
8282
done();
8383
}).catch(done);
8484
});
85-
xit('txlistinternal by address', function (done) {
8685

87-
var txlist = api.account.txlistinternal(null, '0x3FAcfa472e86E3EDaEaa837f6BA038ac01F7F539');
86+
// address does not exist in ropsten
87+
it.skip('txlistinternal by address', function (done) {
88+
89+
var txlist = api.account.txlistinternal(null, '0x2c1ba59d6f58433fb1eaee7d20b26ed83bda51a3', 0, 2702578);
8890
txlist.then(function (res) {
8991
assert.ok(res);
9092
done();
@@ -171,7 +173,7 @@ describe('testnet methods', function () {
171173
}).catch(done);
172174
});
173175

174-
xit('contract.getabi', function (done) {
176+
it('contract.getabi', function (done) {
175177
var api = init(process.env.API_KEY, 'ropsten');
176178
// Has no contract with this address
177179
// var abi = api.contract.getabi('0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413');
@@ -210,7 +212,7 @@ describe('testnet methods', function () {
210212
});
211213

212214

213-
it.skip('proxy.eth_getUncleByBlockNumberAndIndex', function (done) {
215+
it('proxy.eth_getUncleByBlockNumberAndIndex', function (done) {
214216

215217
var res = api.proxy.eth_getUncleByBlockNumberAndIndex('0x210A9B', '0x0');
216218
res.then(function (res) {
@@ -238,7 +240,7 @@ describe('testnet methods', function () {
238240
});
239241

240242

241-
it.skip('proxy.eth_getTransactionByBlockNumberAndIndex', function (done) {
243+
it('proxy.eth_getTransactionByBlockNumberAndIndex', function (done) {
242244

243245
var res = api.proxy.eth_getTransactionByBlockNumberAndIndex('0x10d4f', '0x0');
244246
res.then(function (res) {
@@ -255,8 +257,9 @@ describe('testnet methods', function () {
255257
done();
256258
});
257259
});
258-
259-
xit('proxy.eth_sendRawTransaction', function (done) {
260+
261+
// I can not test this. Example required
262+
it.skip('proxy.eth_sendRawTransaction', function (done) {
260263

261264
var res = api.proxy.eth_sendRawTransaction('0xf904808000831cfde080');
262265
res.then(function (res) {

0 commit comments

Comments
 (0)