Skip to content

Commit

Permalink
Fix missing PLACES_PROVIDER field. Add VERSION field.
Browse files Browse the repository at this point in the history
  • Loading branch information
kochis committed Dec 7, 2018
1 parent 922821d commit a11608a
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Web JavaScript SDK for Radar, the location platform for mobile apps",
"homepage": "https://radar.io",
"license": "Apache-2.0",
"version": "1.0.0-beta4",
"version": "1.0.0-beta5",
"main": "dist/index.js",
"module": "src/index.js",
"files": [
Expand Down
14 changes: 9 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
import * as Cookie from './cookie';
import * as Device from './device';
import * as Http from './http';
import PLACES_PROVIDER from './places_providers';
import SDK_VERSION from './version';
import STATUS from './status_codes';

const DEFAULT_HOST = 'https://api.radar.io';

const PLACES_PROVIDER = {
FACEBOOK: 'facebook',
NONE: 'none'
};

class Radar {
static get VERSION() {
return SDK_VERSION;
}

static get PLACES_PROVIDER() {
return PLACES_PROVIDER;
}

static initialize(publishableKey) {
if (!publishableKey) {
console.error('Radar "initialize" was called without a publishable key');
Expand Down
4 changes: 4 additions & 0 deletions src/places_providers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
FACEBOOK: 'facebook',
NONE: 'none'
};
2 changes: 1 addition & 1 deletion src/version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default '1.0.0-beta4';
export default '1.0.0-beta5';
13 changes: 13 additions & 0 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import * as Cookie from '../src/cookie';
import * as Device from '../src/device';
import * as Http from '../src/http';
import Radar from '../src/index';
import PLACES_PROVIDER from '../src/places_providers';
import SDK_VERSION from '../src/version';
import STATUS from '../src/status_codes';

Expand All @@ -27,6 +28,18 @@ describe('Radar', () => {
Cookie.setCookie.restore();
});

describe('VERSION', () => {
it('should return sdk version', () => {
expect(Radar.VERSION).to.eq(SDK_VERSION);
});
});

describe('PLACES_PROVIDER', () => {
it('should return places providers object', () => {
expect(Radar.PLACES_PROVIDER).to.eql(PLACES_PROVIDER);
});
});

describe('initialize', () => {
context('no publishable key given', () => {
before(() => {
Expand Down

0 comments on commit a11608a

Please sign in to comment.