particle-api-js 10.3.0 → 10.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,36 +2,36 @@ const { expect, sinon } = require('./test-setup');
2
2
  const Particle = require('../src/Particle');
3
3
 
4
4
  describe('Particle', () => {
5
- let api;
5
+ let api;
6
6
 
7
- beforeEach(() => {
8
- api = new Particle({ baseUrl: '' });
9
- });
7
+ beforeEach(() => {
8
+ api = new Particle({ baseUrl: '' });
9
+ });
10
10
 
11
- describe('downloadFile', () => {
12
- it('download the file', () => {
13
- const uri = 'https://binaries.particle.io/libraries/neopixel/neopixel-0.0.10.tar.gz';
14
- const fileSize = 25505;
15
- return api.downloadFile({ uri })
16
- .then(contents => {
17
- expect(contents.length || contents.byteLength).to.equal(fileSize);
18
- });
19
- });
20
- });
11
+ describe('downloadFile', () => {
12
+ it('download the file', () => {
13
+ const uri = 'https://binaries.particle.io/libraries/neopixel/neopixel-0.0.10.tar.gz';
14
+ const fileSize = 25505;
15
+ return api.downloadFile({ uri })
16
+ .then(contents => {
17
+ expect(contents.length || contents.byteLength).to.equal(fileSize);
18
+ });
19
+ });
20
+ });
21
21
 
22
- describe('context', () => {
23
- it('adds headers for the context', () => {
24
- api.setContext('tool', { name:'cli', version:'1.2.3' });
25
- api.setContext('project', { name:'blinky', version:'0.0.1' });
26
- api.agent._promiseResponse = sinon.stub().resolves();
27
- return api.flashTinker('deviceID', 'auth').then(() => {
28
- expect(api.agent._promiseResponse).to.have.been.calledOnce;
29
- const req = api.agent._promiseResponse.firstCall.args[0];
30
- const options = req[1];
31
- expect(req).to.be.ok;
32
- expect(options.headers).to.have.property('X-Particle-Tool').eql('cli@1.2.3');
33
- expect(options.headers).to.have.property('X-Particle-Project').eql('blinky; version=0.0.1');
34
- });
35
- });
36
- });
22
+ describe('context', () => {
23
+ it('adds headers for the context', () => {
24
+ api.setContext('tool', { name:'cli', version:'1.2.3' });
25
+ api.setContext('project', { name:'blinky', version:'0.0.1' });
26
+ api.agent._promiseResponse = sinon.stub().resolves();
27
+ return api.flashTinker('deviceID', 'auth').then(() => {
28
+ expect(api.agent._promiseResponse).to.have.been.calledOnce;
29
+ const req = api.agent._promiseResponse.firstCall.args[0];
30
+ const options = req[1];
31
+ expect(req).to.be.ok;
32
+ expect(options.headers).to.have.property('X-Particle-Tool').eql('cli@1.2.3');
33
+ expect(options.headers).to.have.property('X-Particle-Project').eql('blinky; version=0.0.1');
34
+ });
35
+ });
36
+ });
37
37
  });