Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
5518022a
Commit
5518022a
authored
Jan 08, 2015
by
Marek Kotewicz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mocha test init
parent
807ec60e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
0 deletions
+49
-0
methods.js
test/methods.js
+49
-0
No files found.
test/methods.js
0 → 100644
View file @
5518022a
require
(
'es6-promise'
).
polyfill
();
var
assert
=
require
(
'assert'
);
var
web3
=
require
(
'../index.js'
);
web3
.
setProvider
(
new
web3
.
providers
.
WebSocketProvider
(
'http://localhost:8080'
));
// TODO: create some mock provider
var
methodExists
=
function
(
object
,
method
)
{
assert
.
equal
(
'function'
,
typeof
object
[
method
],
'method '
+
method
+
' is not implemented'
);
};
var
propertyExists
=
function
(
object
,
property
)
{
assert
.
equal
(
'object'
,
typeof
object
[
property
],
'property '
+
property
+
' is not implemented'
);
};
describe
(
'web3'
,
function
()
{
describe
(
'eth'
,
function
()
{
it
(
'should have all methods implemented'
,
function
()
{
methodExists
(
web3
.
eth
,
'balanceAt'
);
methodExists
(
web3
.
eth
,
'stateAt'
);
methodExists
(
web3
.
eth
,
'storageAt'
);
methodExists
(
web3
.
eth
,
'countAt'
);
methodExists
(
web3
.
eth
,
'codeAt'
);
methodExists
(
web3
.
eth
,
'transact'
);
methodExists
(
web3
.
eth
,
'call'
);
methodExists
(
web3
.
eth
,
'block'
);
methodExists
(
web3
.
eth
,
'transaction'
);
methodExists
(
web3
.
eth
,
'uncle'
);
methodExists
(
web3
.
eth
,
'compilers'
);
methodExists
(
web3
.
eth
,
'lll'
);
methodExists
(
web3
.
eth
,
'solidity'
);
methodExists
(
web3
.
eth
,
'serpent'
);
methodExists
(
web3
.
eth
,
'logs'
);
});
it
(
'should have all properties implemented'
,
function
()
{
propertyExists
(
web3
.
eth
,
'coinbase'
);
propertyExists
(
web3
.
eth
,
'listening'
);
propertyExists
(
web3
.
eth
,
'mining'
);
propertyExists
(
web3
.
eth
,
'gasPrice'
);
propertyExists
(
web3
.
eth
,
'account'
);
propertyExists
(
web3
.
eth
,
'accounts'
);
propertyExists
(
web3
.
eth
,
'peerCount'
);
propertyExists
(
web3
.
eth
,
'defaultBlock'
);
propertyExists
(
web3
.
eth
,
'number'
);
});
});
})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment