@parity/light.js
Version:
A high-level reactive JS library optimized for light clients
23 lines (22 loc) • 771 B
JavaScript
;
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
// This file is part of Parity.
//
// SPDX-License-Identifier: MIT
Object.defineProperty(exports, "__esModule", { value: true });
var Api = require("@parity/api");
var api_1 = require("./api");
var mockApi_1 = require("./utils/testHelpers/mockApi");
it('should return the Null provider', function () {
expect(api_1.getApi).toThrow();
});
it('should correctly set a new api', function () {
var api = mockApi_1.resolveApi();
api_1.setApi(api);
expect(api_1.getApi()).toBe(api);
});
it('should correctly set a new provider', function () {
var provider = new Api.Provider.Ws('ws://127.0.0.1:8546');
api_1.setProvider(provider);
expect(api_1.getApi().provider).toBe(provider);
});