@helium/http
Version:
HTTP library for interacting with the Helium blockchain API
40 lines • 1.68 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const nock_1 = __importDefault(require("nock"));
const Client_1 = __importDefault(require("../../Client"));
describe('get location', () => {
(0, nock_1.default)('https://api.helium.io')
.get('/v1/locations/mock-location')
.reply(200, {
data: {
short_street: 'short street',
short_state: 'short state',
short_country: 'short country',
short_city: 'short city',
long_street: 'long street',
long_state: 'long state',
long_country: 'long country',
long_city: 'long city',
location: 'mock-location',
city_id: 'city id',
},
});
it('gets location details', async () => {
const client = new Client_1.default();
const location = await client.locations.get('mock-location');
expect(location.shortStreet).toBe('short street');
expect(location.shortState).toBe('short state');
expect(location.shortCountry).toBe('short country');
expect(location.shortCity).toBe('short city');
expect(location.longStreet).toBe('long street');
expect(location.longState).toBe('long state');
expect(location.longCountry).toBe('long country');
expect(location.longCity).toBe('long city');
expect(location.location).toBe('mock-location');
expect(location.cityId).toBe('city id');
});
});
//# sourceMappingURL=Locations.spec.js.map