Testing

Requirements

  • PhantomJS (for wallaby)

Running tests

  1. 1.
    Build assets. cd apps/block_scout_web/assets && npm run build; cd -
  2. 2.
    Format Elixir code. mix format
  3. 3.
    Run the test suite with coverage for whole umbrella project. This step can be run with different configuration outlined below. mix coveralls.html --umbrella
  4. 4.
    Lint Elixir code. mix credo --strict
  5. 5.
    Run the dialyzer. mix dialyzer --halt-exit-status
  6. 6.
    Check the Elixir code for vulnerabilities. cd apps/explorer && mix sobelow --config; cd - cd apps/block_scout_web && mix sobelow --config; cd -
  7. 7.
    Lint JavaScript code. cd apps/block_scout_web/assets && npm run eslint; cd -
  8. 8.
    Test JavaScript code. cd apps/block_scout_web/assets && npm run test; cd -

Parity

Mox
This is the default setup. mix coveralls.html --umbrella will work on its own, but to be explicit, use the following setup:
1
export ETHEREUM_JSONRPC_CASE=EthereumJSONRPC.Case.Parity.Mox
2
export ETHEREUM_JSONRPC_WEB_SOCKET_CASE=EthereumJSONRPC.WebSocket.Case.Mox
3
mix coveralls.html --umbrella --exclude no_parity
Copied!
HTTP / WebSocket
1
export ETHEREUM_JSONRPC_CASE=EthereumJSONRPC.Case.Parity.HTTPWebSocket
2
export ETHEREUM_JSONRPC_WEB_SOCKET_CASE=EthereumJSONRPC.WebSocket.Case.Parity
3
mix coveralls.html --umbrella --exclude no_parity
Copied!
Protocol
URL
HTTP
http://localhost:8545
WebSocket
ws://localhost:8546

Geth

Mox
1
export ETHEREUM_JSONRPC_CASE=EthereumJSONRPC.Case.Geth.Mox
2
export ETHEREUM_JSONRPC_WEB_SOCKET_CASE=EthereumJSONRPC.WebSocket.Case.Mox
3
mix coveralls.html --umbrella --exclude no_geth
Copied!
HTTP / WebSocket
1
export ETHEREUM_JSONRPC_CASE=EthereumJSONRPC.Case.Geth.HTTPWebSocket
2
export ETHEREUM_JSONRPC_WEB_SOCKET_CASE=EthereumJSONRPC.WebSocket.Case.Geth
3
mix coveralls.html --umbrella --exclude no_geth
Copied!
Protocol
URL
HTTP
https://mainnet.infura.io/8lTvJTKmHPCHazkneJsY
WebSocket
wss://mainnet.infura.io/ws/8lTvJTKmHPCHazkneJsY
Last modified 2yr ago
Export as PDF
Copy link