Skip to content

Commit 72c15e1

Browse files
author
Joe Goggins
committed
Adds defaultAuth constructor property and test coverage for expected defaults
1 parent fd35d3d commit 72c15e1

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

src/Defaults.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ export default {
22
baseUrl: 'https://api.particle.io',
33
clientSecret: 'particle-api',
44
clientId: 'particle-api',
5-
tokenDuration: 7776000 // 90 days
5+
tokenDuration: 7776000, // 90 days
6+
defaultAuth: undefined
67
};

test/Defaults.spec.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { expect } from './test-setup';
2+
import Defaults from '../src/Defaults';
3+
4+
describe('Default Particle constructor options', () => {
5+
it('includes baseUrl', () => {
6+
expect(Defaults).to.have.property('baseUrl');
7+
expect(Defaults.baseUrl).to.eql('https://api.particle.io');
8+
});
9+
10+
it('includes clientSecret', () => {
11+
expect(Defaults).to.have.property('clientSecret');
12+
expect(Defaults.clientSecret).to.eql('particle-api');
13+
});
14+
15+
it('includes clientId', () => {
16+
expect(Defaults).to.have.property('clientId');
17+
expect(Defaults.clientId).to.eql('particle-api');
18+
});
19+
20+
it('includes tokenDuration', () => {
21+
expect(Defaults).to.have.property('tokenDuration');
22+
expect(Defaults.tokenDuration).to.eql(7776000);
23+
});
24+
25+
it('includes defaultAuth', () => {
26+
expect(Defaults).to.have.property('defaultAuth');
27+
expect(Defaults.defaultAuth).to.eql(undefined);
28+
});
29+
});

0 commit comments

Comments
 (0)