embark/dapps/tests/contracts
emizzle 7dfa2b939c fix(@embark/dapps): Contracts app test failure
During `embark test`, the contracts dapp was throwing an error:
```
connection not open on send()
Error: Invalid JSON RPC response: ""
    at Object.InvalidResponse (/Users/michael/repos/embark/node_modules/web3-core-helpers/src/errors.js:42:16)
    at XMLHttpRequest.request.onreadystatechange (/Users/michael/repos/embark/node_modules/web3-providers-http/src/index.js:92:32)
    at XMLHttpRequestEventTarget.dispatchEvent (/Users/michael/repos/embark/node_modules/xhr2-cookies/xml-http-request-event-target.ts:44:13)
    at XMLHttpRequest._setReadyState (/Users/michael/repos/embark/node_modules/xhr2-cookies/xml-http-request.ts:219:8)
    at XMLHttpRequest._onHttpRequestError (/Users/michael/repos/embark/node_modules/xhr2-cookies/xml-http-request.ts:379:8)
    at ClientRequest.<anonymous> (/Users/michael/repos/embark/node_modules/xhr2-cookies/xml-http-request.ts:266:37)
    at ClientRequest.emit (events.js:198:13)
    at Socket.socketErrorListener (_http_client.js:392:9)
    at Socket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)
(node:75120) UnhandledPromiseRejectionWarning: Error: Provider not set or invalid
...
```

This was due to the fact that during testing, the Ganache VM **provider** is used as the blockchain node, instead of spinning up an instance of Ganache. Due to this, there is no HTTP nor WebSockets RPC endpoint opened on the VM node, and the contracts dapp was not able to connect to the node during tests.

Add `$EMBARK` to the contract config’s `dappConnection` list, so that the contract test dapp can successfully connect to Embark’s proxy, which ultimately communicates with the Ganache VM.

As a side note, without `$EMBARK` in the `dappConnection` list, the tests could run successfully when using `embark test —node=embark`. This succeeds because the geth node exposes the RPC WebSockets endpoint that the contracts app connects to on `ws://localhost:8546`.
2019-12-17 10:44:01 -05:00
..
contracts build: make DApp templates member packages of the monorepo 2019-03-05 10:20:57 -06:00
privatenet build: make DApp templates member packages of the monorepo 2019-03-05 10:20:57 -06:00
rinkeby build: make DApp templates member packages of the monorepo 2019-03-05 10:20:57 -06:00
ropsten build: make DApp templates member packages of the monorepo 2019-03-05 10:20:57 -06:00
test feat(@embark/ens): enable changing namesystem config per test 2019-11-12 09:31:05 -05:00
.npmrc build: make DApp templates member packages of the monorepo 2019-03-05 10:20:57 -06:00
CHANGELOG.md chore(release): 5.0.0-alpha.5 2019-12-16 13:49:41 -05:00
README.md build: tidy up the monorepo in prep for v5.0.0-alpha.0 2019-10-01 13:29:53 -05:00
blockchain.json build: make DApp templates member packages of the monorepo 2019-03-05 10:20:57 -06:00
contracts.json fix(@embark/dapps): Contracts app test failure 2019-12-17 10:44:01 -05:00
embark.json refactor(@embark/library-manager): restrict versionable packages to only solc 2019-11-08 11:27:20 -06:00
ens.json feat(@embark/ens): enable changing namesystem config per test 2019-11-12 09:31:05 -05:00
package.json chore(release): 5.0.0-alpha.5 2019-12-16 13:49:41 -05:00

README.md

embark-dapp-test-contracts

Test DApp for integration testing purposes

In the top-level of the monorepo

yarn globalize to make development embark available on the global PATH.

In this directory

embark run to check if everything is behaving as expected.

embark test to see tests are working as expected.

Visit embark.status.im to get started with Embark.