test_3dp.js 757 B

12345678910111213141516171819202122232425262728
  1. function expect(actual, matcher) {
  2. if (actual !== matcher) {
  3. throw new Error(`expect ${matcher}, got ${actual}`);
  4. }
  5. }
  6. async function runConnectTest() {
  7. console.log("test connect");
  8. const endpoint = "wss://rpc.3dpscan.io";
  9. const connected = await settings.connect([endpoint]);
  10. // expect(connected, endpoint);
  11. expect(!!api, true);
  12. console.log("test get consts");
  13. const constants = await settings.getNetworkConst(api);
  14. expect(constants.balances.existentialDeposit.toHuman(), api.consts.balances.existentialDeposit.toHuman());
  15. console.log("settings tests passed.");
  16. }
  17. async function run3dpTests() {
  18. await runConnectTest();
  19. console.log("all tests passed.");
  20. }
  21. window.runTests = runTests;